50 lines
922 B
Bash
Executable File
50 lines
922 B
Bash
Executable File
### Copyright 1999-2025. WebPros International GmbH. All rights reserved.
|
|
|
|
[ -z "$PLESK_INSTALLER_DEBUG" ] || set -x
|
|
[ -z "$PLESK_INSTALLER_STRICT_MODE" ] || set -e
|
|
|
|
# Restart apache on package remove.
|
|
|
|
deferred_apache_restart()
|
|
{
|
|
touch "/var/lock/plesk_deferred_apache_restart"
|
|
}
|
|
|
|
try_restart_service()
|
|
{
|
|
local service="$1"
|
|
if [ -n "$service" ]; then
|
|
local pleskrc="/usr/local/psa/admin/sbin/pleskrc"
|
|
$pleskrc "$service" exists && $pleskrc "$service" try-restart >/dev/null 2>&1 || :
|
|
else
|
|
echo "try_restart_service: service name missed" >&2
|
|
fi
|
|
}
|
|
|
|
try_restart_apache()
|
|
{
|
|
if [ -f "/tmp/pp-bootstrapper-mode.flag" ]; then
|
|
deferred_apache_restart
|
|
else
|
|
try_restart_service apache
|
|
fi
|
|
}
|
|
|
|
|
|
case "$1" in
|
|
remove)
|
|
try_restart_apache
|
|
;;
|
|
failed-upgrade|abort-install|abort-upgrade|disappear|upgrade|purge)
|
|
;;
|
|
*)
|
|
echo "postrm called with unknown argument '$1'" >&2
|
|
exit 0
|
|
;;
|
|
esac
|
|
|
|
|
|
exit 0
|
|
|
|
# vim:ft=sh
|