add variable check to cease.sh
This commit is contained in:
parent
7525e3a569
commit
efcb0bdd08
4
cease.sh
4
cease.sh
|
@ -40,7 +40,9 @@ if vmctl show ${1%.txt} >/dev/null 2>&1; then
|
|||
dig +short -x $(grep -A2 ${1%.txt} /etc/dhcpd.conf | awk '/fixed/ {print $2}' | tr -d ';')
|
||||
remove.pl ${1}
|
||||
deploy.pl
|
||||
if [[ -z ${DHCPD} ]]; then
|
||||
rcctl restart dhcpd
|
||||
fi
|
||||
vmctl reload
|
||||
fi
|
||||
fi
|
||||
|
@ -51,6 +53,8 @@ elif [[ "${SERVER}" == mega* ]]; then
|
|||
HOST="m${SERVER#mega}"
|
||||
fi
|
||||
|
||||
if [[ "${SERVER}" == server* ]] || [[ "${SERVER}" == mega* ]]; then
|
||||
openrsync -va --del /home/mischa/vms/ mischa@wm1.obsda.ms:vms/${HOST}/
|
||||
ssh wm1.obsda.ms "doas userdel -r ${HOST}${1%.txt} && doas groupdel ${HOST}${1%.txt}"
|
||||
openrsync -va --del /home/mischa/vms/ mischa@rx.high5.nl:vms/${HOST}/
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue