restart nginx and vnc if needed

This commit is contained in:
Maxim Devaev 2022-06-24 20:36:26 +03:00
parent 0101a4f79f
commit f634be16f0

View File

@ -46,6 +46,13 @@ function create_tmp() {
trap cleanup EXIT trap cleanup EXIT
} }
function restart_if_running() {
if systemctl is-active --quiet "$2"; then
echo "=> systemctl $1 $2"
systemctl "$1" "$2" || true
fi
}
if [ "$1" == "renew" ]; then if [ "$1" == "renew" ]; then
create_tmp create_tmp
cp -a "$cur"/{config,work,logs} "$tmp" cp -a "$cur"/{config,work,logs} "$tmp"
@ -69,8 +76,8 @@ if [ "$1" == "renew" ]; then
kvmd-helper-swapfiles '$new' '$cur' kvmd-helper-swapfiles '$new' '$cur'
rm -rf '$new' rm -rf '$new'
" "
echo "Reloading KVMD-Nginx ..." restart_if_running reload kvmd-nginx
systemctl reload kvmd-nginx || true restart_if_running restart kvmd-vnc
fi fi
else else