changes to allow for remote control
This commit is contained in:
parent
6f6364cd45
commit
f72c728cfd
17
cease.sh
17
cease.sh
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2019-2022 Mischa Peters <mischa @ openbsd.amsterdam>
|
||||
# Copyright (c) 2019-2024 Mischa Peters <mischa @ openbsd.amsterdam>
|
||||
#
|
||||
# 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
|
||||
|
|
19
launch.sh
19
launch.sh
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2019-2023 Mischa Peters <mischa @ openbsd.amsterdam>
|
||||
# Copyright (c) 2019-2024 Mischa Peters <mischa @ openbsd.amsterdam>
|
||||
#
|
||||
# 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"
|
||||
|
|
Loading…
Reference in New Issue