freeswitch/debian/freeswitch.postinst
Travis Cross c79509a367 Use /var/lib/freeswitch as home directory on Debian
Previously we were using /var/run/freeswitch.

Julian pointed out that someone may actually want to keep information
around in the home directory.  For Gemeinschaft they need to keep the
.odbc.ini file here.

Thanks-to: Julian Pawlowski <julian.pawlowski@gmail.com>
2012-12-18 17:43:04 +00:00

40 lines
834 B
Bash

#!/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 \
-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
mkdir -p $x
chown -R freeswitch:freeswitch $x
chmod -R o-rwx,g+u $x
done
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0