2021-10-12 17:00:35 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-02-01 20:07:18 +00:00
|
|
|
if [ -d "/run/systemd/system" ]; then
|
|
|
|
systemctl --system daemon-reload >/dev/null || :
|
2021-10-12 17:00:35 +00:00
|
|
|
fi
|
|
|
|
|
2022-02-01 20:07:18 +00:00
|
|
|
case "$1" in
|
|
|
|
purge | 0)
|
|
|
|
userdel consul
|
|
|
|
;;
|
2021-10-12 17:00:35 +00:00
|
|
|
|
2022-02-01 20:07:18 +00:00
|
|
|
upgrade | [1-9]*)
|
|
|
|
if [ -d "/run/systemd/system" ]; then
|
|
|
|
systemctl try-restart consul.service >/dev/null || :
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2021-10-12 17:00:35 +00:00
|
|
|
|
2022-02-01 20:07:18 +00:00
|
|
|
exit 0
|