Skip to content

Instantly share code, notes, and snippets.

@dportok
Created June 29, 2019 21:09
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 dportok/15c6a5b54f4b58f6e2029aadc58d2f75 to your computer and use it in GitHub Desktop.
Save dportok/15c6a5b54f4b58f6e2029aadc58d2f75 to your computer and use it in GitHub Desktop.
Deprovisioning script
#!/bin/sh -x
# Constant declaration
GREEN="\e[32m===> "
RESET="\e[0m"
# Deprovision and generalize the image
echo -e "\n${GREEN}Came back from reboot...${RESET}"
echo -e "\n${GREEN}Deprovisiong the system...${RESET}\n"
/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment