1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-21 10:15:12 +03:00
aports/community/postsrsd/postsrsd.pre-upgrade
2023-01-01 18:11:22 +00:00

25 lines
728 B
Bash

#!/bin/sh
ver_old="$2"
if [ "$(apk version -t "$ver_old" '2.0.0-r0')" = '<' ]; then
cat <<-EOF >&2
Version 2.0 of postsrsd is a complete rewrite. The configuration comes
from a configuration file instead of command line arguments to the daemon.
Make sure you migrate your configuration to /etc/postsrsd/postsrsd.conf.
See: https://github.com/roehling/postsrsd/releases/tag/2.0.0
EOF
if ! [ -d /var/lib/postsrsd ] && id postsrsd >/dev/null 2>&1; then
current_uid=$(id -u postsrsd)
current_gid=$(id -g postsrsd)
deluser postsrsd
addgroup -S postsrsd -g "$current_gid" 2>/dev/null
adduser -S -D -h /var/lib/postsrsd -s /bin/false -u "$current_uid" -G postsrsd -g postsrsd postsrsd 2>/dev/null
fi
fi
exit 0