Created
May 11, 2020 11:28
-
-
Save honzahommer/fe6b3f1ad5be60adf5c22e0e1ed4f165 to your computer and use it in GitHub Desktop.
XS vApp autostart
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
#!/bin/bash | |
# Crontab | |
# @reboot root /path/to/autostart.sh 60 | |
xe_param() { | |
awk -v param="$1" '$1 == param' | awk -F': ' '{ print $NF }' | |
} | |
if [[ $1 -gt 0 ]]; then | |
sleep "$1" | |
fi | |
xe appliance-list | xe_param uuid | while read -r uuid; do | |
if xe appliance-param-get uuid="$uuid" param-name="name-description" | grep -iqw autostart; then | |
xe appliance-start uuid="$uuid" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment