diff --git a/cease.sh b/cease.sh index b7452c9..4ceca74 100755 --- a/cease.sh +++ b/cease.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2019-2022 Mischa Peters +# Copyright (c) 2019-2024 Mischa Peters # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -14,6 +14,9 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # +SSHOPTIONS='-p 31415 -l mischa -i /home/mischa/.ssh/id_ed25519' +BINPATH='/home/mischa/bin' + CONF_FILE="${PWD}/_deploy.conf" if [[ -f "${CONF_FILE}" ]]; then . "${CONF_FILE}" @@ -41,8 +44,8 @@ if vmctl show ${1%.txt} >/dev/null 2>&1; then IPV4=$(grep -A2 ${1%.txt} /etc/dhcpd.conf | awk '/fixed/ {print $2}' | tr -d ';') IPV6=$(grep -A3 ${1%.txt} /etc/dhcpd.conf | awk '/fixed-address-ipv6/ {print $2}' | tr -d ';') echo "a reset ${IPV4} ${IPV6}" - remove.pl ${1} - deploy.pl + ${BINPATH}/remove.pl ${1} + ${BINPATH}/deploy.pl if [[ -z ${DHCPD} ]]; then rcctl restart dhcpd fi @@ -57,8 +60,8 @@ elif [[ "${SERVER}" == mega* ]]; then 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}" - ssh wm1.obsda.ms "doas groupdel ${HOST}${1%.txt}" - openrsync -va --del /home/mischa/vms/ mischa@rx.high5.nl:vms/${HOST}/ + openrsync -va --del -e "ssh ${SSHOPTIONS}" /home/mischa/vms/ mischa@wm1.obsda.ms:vms/${HOST}/ + ssh ${SSHOPTIONS} wm1.obsda.ms "doas userdel -r ${HOST}${1%.txt}" + ssh ${SSHOPTIONS} wm1.obsda.ms "doas groupdel ${HOST}${1%.txt}" + openrsync -va --del -e "ssh ${SSHOPTIONS}" /home/mischa/vms/ mischa@rx.high5.nl:vms/${HOST}/ fi diff --git a/launch.sh b/launch.sh index 168364b..c3e1ad2 100755 --- a/launch.sh +++ b/launch.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2019-2023 Mischa Peters +# Copyright (c) 2019-2024 Mischa Peters # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -14,6 +14,9 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # +SSHOPTIONS='-p 31415 -l mischa -i /home/mischa/.ssh/id_ed25519' +BINPATH='/home/mischa/bin' + CONF_FILE="${PWD}/_deploy.conf" if [[ -f "${CONF_FILE}" ]]; then . "${CONF_FILE}" @@ -50,12 +53,12 @@ elif [[ "${SERVER}" == mega* ]]; then fi if [[ "${SERVER}" == server* ]] || [[ "${SERVER}" == mega* ]]; then - openrsync -va --del /home/mischa/vms/ mischa@wm1.obsda.ms:vms/${HOST}/ - ssh wm1.obsda.ms "doas ./create-user.pl ${HOST}${1}" - openrsync -va --del /home/mischa/vms/ mischa@rx.high5.nl:vms/${HOST}/ + openrsync -va --del -e "ssh ${SSHOPTIONS}" /home/mischa/vms/ mischa@wm1.obsda.ms:vms/${HOST}/ + ssh ${SSHOPTIONS} wm1.obsda.ms "doas ./create-user.pl ${HOST}${1}" + openrsync -va --del -e "ssh ${SSHOPTIONS}" /home/mischa/vms/ mischa@rx.high5.nl:vms/${HOST}/ fi -deploy.pl +${BINPATH}/deploy.pl sleep 5 if [[ -z ${DHCPD} ]]; then rcctl restart dhcpd @@ -87,7 +90,7 @@ done > /tmp/pipe_${1} 2> ${LOGS}/${1}.log echo "completed" -deploy.pl +${BINPATH}/deploy.pl sleep 5 if [[ -z ${DHCPD} ]]; then rcctl restart dhcpd @@ -110,5 +113,5 @@ rm -rf /tmp/pipe_${1} echo echo "SUCCES! - deployed ${INSTANCE}" -notify.pl deployed ${1} "${2}" -pushover.pl -m "${SERVER} ${INSTANCE} deployed" -t "OpenBSD Amsterdam" +${BINPATH}/notify.pl deployed ${1} "${2}" +${BINPATH}/pushover.pl -m "${SERVER} ${INSTANCE} deployed" -t "OpenBSD Amsterdam"