ayaports/user/uptime-kuma/uptime-kuma.pre-install

26 lines
552 B
Text
Raw Normal View History

2024-03-03 19:37:09 +00:00
#!/bin/sh
DATADIR='/var/lib/uptime-kuma'
if ! getent group uptime-kuma 1>/dev/null; then
echo '* Creating group uptime-kuma' 1>&2
addgroup -S uptime-kuma
fi
if ! id uptime-kuma 2>/dev/null 1>&2; then
echo '* Creating user uptime-kuma' 1>&2
adduser -DHS -G uptime-kuma -h "$DATADIR" -s /bin/sh \
-g "added by apk for uptime-kuma" uptime-kuma
passwd -u uptime-kuma 1>/dev/null # unlock
fi
if ! id -Gn uptime-kuma | grep -Fq www-data; then
echo '* Adding user uptime-kuma to group www-data' 1>&2
addgroup uptime-kuma www-data
fi
exit 0