Skip to content

Instantly share code, notes, and snippets.

@anl
Last active October 13, 2015 21:07
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 anl/4256042 to your computer and use it in GitHub Desktop.
Save anl/4256042 to your computer and use it in GitHub Desktop.
Purge Ubuntu VM prior to imaging on SmartOS; tested with 12.04.
#!/bin/bash
# This script assumes:
# 1) Joyent's vmtools are installed; and
# 2) /etc/rc.local contains:
# /usr/sbin/dpkg-reconfigure openssh-server
# or the equivalent.
/usr/bin/apt-get update
/usr/bin/apt-get -y dist-upgrade
/usr/bin/apt-get -y autoremove
/usr/sbin/service rsyslog stop
/bin/rm -f /etc/hostname
/lib/smartdc/prepare-image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment