mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-26 06:00:12 +01:00
42 lines
557 B
Plaintext
42 lines
557 B
Plaintext
|
#!/bin/sh
|
||
|
set -e
|
||
|
|
||
|
create_piler_user() {
|
||
|
id piler &>/dev/null
|
||
|
|
||
|
if [ $? -ne 0 ]; then
|
||
|
groupadd piler
|
||
|
useradd -g piler -s /bin/sh -d /var/piler piler
|
||
|
usermod -L piler
|
||
|
fi
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
save_current_config() {
|
||
|
BAKFILE=/usr/local/etc/piler.conf.`date +%s`
|
||
|
cp /usr/local/etc/piler.conf $BAKFILE
|
||
|
}
|
||
|
|
||
|
|
||
|
case "$1" in
|
||
|
install)
|
||
|
create_piler_user
|
||
|
;;
|
||
|
|
||
|
upgrade|abort-upgrade)
|
||
|
save_current_config
|
||
|
;;
|
||
|
|
||
|
*)
|
||
|
echo "postinst called with unknown argument \`$1'" >&2
|
||
|
exit 0
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
#DEBHELPER#
|
||
|
|
||
|
exit 0
|
||
|
|
||
|
|