freeswitch/debian/freeswitch.postinst

48 lines
1.0 KiB
Plaintext
Raw Normal View History

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 \
-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
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
if [ ! -d "/etc/freeswitch" ]; then
mkdir -p /etc/freeswitch/tls/
cp -a /usr/share/freeswitch/conf/vanilla/* /etc/freeswitch/
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