Last active
November 2, 2017 11:15
-
-
Save cvrolf/38102e1e2d67caf3952b09e0aa478885 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@RunAs: Open a Terminal with user root @ Master Machine***** | |
### | |
### Bash Shell behavior | |
# @doc -e Exit immediately if a command returns a non-zero status. | |
# @doc -u Treat unset variables and parameters other than the special parameters ‘@’ or ‘*’ as an error when performing parameter expansion. | |
# @doc -x Print a trace of commands after they are expanded and before they are executed. | |
set -u | |
set -x | |
### | |
### Global vars | |
MYDOMAIN="myvmtest" | |
MYIPADDRESS=192.168.122.102 | |
MYMACADDRESS=52:54:00:ff:ff:66 | |
### | |
### Check you are on the correct host: Host Machine (not the VM) | |
hostname | |
whoami | |
if [ "`hostname`" == "${MYDOMAIN}" ]; then | |
echo "ABORT. This is not a session on the Host Machine" | |
sleep 10 | |
exit 1 | |
else | |
echo "OK. This is a session on the Host Machine" | |
fi | |
### | |
### REBOOT VM | |
virsh list --all | |
virsh reboot --domain ${MYDOMAIN} | |
sleep 10 | |
virsh list --all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment