mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-05 18:44:54 +00:00
It's reasonable for someone to change one or more of these directory permissions after installation. We shouldn't touch more than we need on upgrade. Each directory needs to be owned by the freeswitch user, but past that we can leave discretion to the system administrator.
43 lines
897 B
Bash
43 lines
897 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
|
|
if ! test -d $x; then
|
|
mkdir -p $x
|
|
chown freeswitch:freeswitch $x
|
|
chmod o-rwx,g+u $x
|
|
fi
|
|
chown freeswitch $x
|
|
done
|
|
;;
|
|
abort-upgrade|abort-remove|abort-deconfigure)
|
|
;;
|
|
*)
|
|
echo "postinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
#DEBHELPER#
|
|
exit 0
|