fix missing docs, add missing license

fix broken pre/post scripts for packages
This commit is contained in:
Cody Lee
2022-11-13 14:39:33 -06:00
parent 66e897ace3
commit a6673b4d42
7 changed files with 100 additions and 270 deletions
+9 -9
View File
@@ -9,21 +9,21 @@ OS="$(uname -s)"
if [ "${OS}" = "Linux" ]; then
# Make a user and group for this app, but only if it does not already exist.
id {{BINARY}} >/dev/null 2>&1 || \
useradd --system --user-group --no-create-home --home-dir /tmp --shell /bin/false {{BINARY}}
id unpoller >/dev/null 2>&1 || \
useradd --system --user-group --no-create-home --home-dir /tmp --shell /bin/false unpoller
elif [ "${OS}" = "OpenBSD" ]; then
id {{BINARY}} >/dev/null 2>&1 || \
useradd -g =uid -d /tmp -s /bin/false {{BINARY}}
id unpoller >/dev/null 2>&1 || \
useradd -g =uid -d /tmp -s /bin/false unpoller
elif [ "${OS}" = "FreeBSD" ]; then
id {{BINARY}} >/dev/null 2>&1 || \
pw useradd {{BINARY}} -d /tmp -w no -s /bin/false
id unpoller >/dev/null 2>&1 || \
pw useradd unpoller -d /tmp -w no -s /bin/false
else
echo "Unknown OS: ${OS}, please add system user {{BINARY}} manually."
echo "Unknown OS: ${OS}, please add system user unpoller manually."
fi
if [ -x "/bin/systemctl" ]; then
# Reload and restart - this starts the application as user nobody.
/bin/systemctl daemon-reload
/bin/systemctl enable {{BINARY}}
/bin/systemctl restart {{BINARY}}
/bin/systemctl enable unpoller
/bin/systemctl restart unpoller
fi
+4 -4
View File
@@ -9,9 +9,9 @@ if [ "$1" = "upgrade" ] || [ "$1" = "1" ] ; then
fi
if [ -x "/bin/systemctl" ]; then
/bin/systemctl stop {{BINARY}}
/bin/systemctl disable {{BINARY}}
/bin/systemctl stop unpoller
/bin/systemctl disable unpoller
elif [ -x /usr/sbin/service ]; then
/usr/sbin/service {{BINARY}} stop
/usr/sbin/service {{BINARY}} disable
/usr/sbin/service unpoller stop
/usr/sbin/service unpoller disable
fi