2
0

freeswitch.postinst 897 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. set -e
  3. case "$1" in
  4. configure)
  5. if ! getent group freeswitch >/dev/null; then
  6. groupadd --system freeswitch
  7. fi
  8. if ! getent passwd freeswitch >/dev/null; then
  9. useradd --system -g freeswitch -Gaudio \
  10. -d /var/lib/freeswitch \
  11. -s /bin/false \
  12. -e '' \
  13. -c 'FreeSWITCH' \
  14. freeswitch
  15. fi
  16. for x in \
  17. /var/lib/freeswitch \
  18. /var/lib/freeswitch/db \
  19. /var/lib/freeswitch/recordings \
  20. /var/lib/freeswitch/storage \
  21. /var/log/freeswitch \
  22. /var/run/freeswitch;
  23. do
  24. if ! test -d $x; then
  25. mkdir -p $x
  26. chown freeswitch:freeswitch $x
  27. chmod o-rwx,g+u $x
  28. fi
  29. chown freeswitch $x
  30. done
  31. ;;
  32. abort-upgrade|abort-remove|abort-deconfigure)
  33. ;;
  34. *)
  35. echo "postinst called with unknown argument \`$1'" >&2
  36. exit 1
  37. ;;
  38. esac
  39. #DEBHELPER#
  40. exit 0