renatofilho@905: #! /bin/sh
renatofilho@905: # postinst script for gms
renatofilho@905: 
renatofilho@905: set -e
renatofilho@905: 
renatofilho@905: case "$1" in
renatofilho@905:   configure)
renatofilho@905:     if ! getent passwd gms >/dev/null; then
renatofilho@905:       adduser --disabled-password  --quiet --system \
renatofilho@905:         --home /var/gms-media \
renatofilho@905:         --gecos "GMS media dir" --group gms
renatofilho@905:     fi
renatofilho@905:     if ! getent passwd gms | grep -q /var/run/gms; then
renatofilho@905:         usermod -d /var/gms-media gms
renatofilho@905:     fi
renatofilho@905:     update-rc.d gmsd defaults
renatofilho@905:     invoke-rc.d gmsd start
renatofilho@905:   ;;
renatofilho@905:   abort-upgrade|abort-remove|abort-deconfigure)
renatofilho@905:   ;;
renatofilho@905:   *)
renatofilho@905:     echo "postinst called with unknown argument \`$1'" >&2
renatofilho@905:     exit 1
renatofilho@905:   ;;
renatofilho@905: esac
renatofilho@905: 
renatofilho@905: #DEBHELPER#
renatofilho@905: 
renatofilho@905: exit 0