5
# This script is executed at the end of each multiuser runlevel.
6
# Make sure that the script will "exit 0" on success or any other
9
# In order to enable or disable this script just change the execution
12
# By default this script does nothing.
13
####### These lines go at the end of /etc/rc.local #######
14
. /lib/lsb/init-functions
16
echo Downloading payload from userdata
17
wget http://169.254.169.254/latest/user-data -O /tmp/payload.b64
18
echo Decrypting base64 payload
19
openssl enc -d -base64 -in /tmp/payload.b64 -out /tmp/payload.zip
22
echo Unzipping payload file
23
unzip -o /tmp/payload.zip -d /tmp/payload/
25
# if the autorun.sh script exists, run it
26
if [ -e /tmp/payload/autorun.sh ]; then
27
echo Running autorun.sh
29
sh /tmp/payload/autorun.sh
32
echo rc.local : No autorun script to run