mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 17:20:30 +08:00
restart nginx and vnc if needed
This commit is contained in:
parent
0101a4f79f
commit
f634be16f0
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user