diff options
author | B. Stack <bgstack15@gmail.com> | 2022-02-15 22:49:00 -0500 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-02-15 22:49:00 -0500 |
commit | df2fbdc9bd4387ee72d2b38df9abf0778175c2d4 (patch) | |
tree | 763dae2b1480e10e82427c476434802523474d27 /debian/postinst | |
parent | suppress useless stuff from auth (diff) | |
download | stackbin-df2fbdc9bd4387ee72d2b38df9abf0778175c2d4.tar.gz stackbin-df2fbdc9bd4387ee72d2b38df9abf0778175c2d4.tar.bz2 stackbin-df2fbdc9bd4387ee72d2b38df9abf0778175c2d4.zip |
add initial debian package recipe
Diffstat (limited to 'debian/postinst')
-rw-r--r-- | debian/postinst | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..fdcc7ee --- /dev/null +++ b/debian/postinst @@ -0,0 +1,35 @@ +#!/bin/sh +set -e + +#DEBHELPER# +OUT=/dev/null +USERNAME=stackbin +HOME=/var/stackbin +SERVICE=stackbin + +case "$1" in + configure) + update-rc.d ${SERVICE} defaults + if ! getent passwd ${USERNAME} 1>${OUT} 2>&1 ; + then + echo "Creating ${USERNAME} system user & group..." + adduser --quiet --system --home $HOME \ + --disabled-password --group \ + --gecos "stackbin system user" \ + ${USERNAME} > ${OUT} 2>&1 + fi + chown ${USERNAME}:${USERNAME} \ + ${HOME} ${HOME}/* \ + /var/log/${SERVICE} /var/log/${SERVICE}/*log 1>/${OUT} 2>&1 || : + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 |