Skip to content

Instantly share code, notes, and snippets.

@honzahommer
Created May 11, 2020 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save honzahommer/fe6b3f1ad5be60adf5c22e0e1ed4f165 to your computer and use it in GitHub Desktop.
Save honzahommer/fe6b3f1ad5be60adf5c22e0e1ed4f165 to your computer and use it in GitHub Desktop.
XS vApp autostart
#!/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