2012-02-23 20:03:09 -05:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
configure)
|
|
|
|
if ! getent group freeswitch >/dev/null; then
|
|
|
|
groupadd --system freeswitch
|
|
|
|
fi
|
|
|
|
if ! getent passwd freeswitch >/dev/null; then
|
|
|
|
useradd --system -g freeswitch -Gaudio \
|
2012-12-18 12:42:47 -05:00
|
|
|
-d /var/lib/freeswitch \
|
2012-02-23 20:03:09 -05:00
|
|
|
-s /bin/false \
|
|
|
|
-e '' \
|
|
|
|
-c 'FreeSWITCH' \
|
|
|
|
freeswitch
|
|
|
|
fi
|
|
|
|
for x in \
|
|
|
|
/var/lib/freeswitch \
|
|
|
|
/var/lib/freeswitch/db \
|
|
|
|
/var/lib/freeswitch/recordings \
|
|
|
|
/var/lib/freeswitch/storage \
|
|
|
|
/var/log/freeswitch \
|
|
|
|
/var/run/freeswitch;
|
|
|
|
do
|
2014-08-28 08:24:44 -04:00
|
|
|
if ! test -d $x; then
|
|
|
|
mkdir -p $x
|
|
|
|
chown freeswitch:freeswitch $x
|
|
|
|
chmod o-rwx,g+u $x
|
|
|
|
fi
|
|
|
|
chown freeswitch $x
|
2012-02-23 20:03:09 -05:00
|
|
|
done
|
2015-06-17 23:40:19 -04:00
|
|
|
if [ ! -d "/etc/freeswitch" ]; then
|
2015-10-02 10:56:35 -04:00
|
|
|
mkdir -p /etc/freeswitch/
|
2016-03-17 09:42:39 -04:00
|
|
|
if [ -e /usr/share/freeswitch/conf/vanilla/freeswitch.xml ]; then
|
|
|
|
cp -a /usr/share/freeswitch/conf/vanilla/* /etc/freeswitch/
|
|
|
|
fi
|
2015-10-02 10:56:35 -04:00
|
|
|
fi
|
|
|
|
if [ ! -d "/etc/freeswitch/tls" ]; then
|
2015-09-15 18:35:05 -04:00
|
|
|
mkdir -p /etc/freeswitch/tls/
|
2015-09-22 00:53:23 -04:00
|
|
|
chown freeswitch:freeswitch /etc/freeswitch/tls
|
2015-06-17 23:40:19 -04:00
|
|
|
fi
|
2012-02-23 20:03:09 -05:00
|
|
|
;;
|
|
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|