postinst is in motion 4.0-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #!/bin/sh
# postinst script for motion
# Made by Angel Carpintero
set -e
. /usr/share/debconf/confmodule
add_group_if_missing() {
if ! getent group motion >/dev/null; then
addgroup --system --force-badname motion || true
fi
}
add_user_if_missing() {
if ! id -u motion > /dev/null 2>&1; then
mkdir -m 02750 -p /var/lib/motion
adduser --system --home /var/lib/motion \
--disabled-password \
--force-badname motion \
--ingroup motion
adduser motion video
chown motion:adm /var/lib/motion
fi
}
add_group_if_missing
add_user_if_missing
db_stop
# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
if [ -x "/etc/init.d/motion" ]; then
update-rc.d motion defaults >/dev/null
invoke-rc.d motion start || exit $?
fi
fi
# End automatically added section
exit 0
|