We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7a2b0c3 + 940a71a commit c60badfCopy full SHA for c60badf
bin/test-boot
@@ -23,10 +23,20 @@ POWEROFF=${POWEROFF:-false}
23
24
echo '{"instance-id": "9068aef2-213e-4e43-830f-accdbadde897"}' > meta-data
25
26
-if [ "true" == $POWEROFF ]; then
27
- { echo '#!/bin/sh'; echo 'echo Hello from inside'; echo 'poweroff -f'; } > user-data
28
-else
+if [ "$POWEROFF" != "true" ]; then
29
echo "" > user-data
+else
+ cat >user-data <<"EOF"
30
+#!/bin/sh
31
+rclocal="/etc/rc.local"
32
+cat >>$rclocal <<"END_RC_LOCAL"
33
34
+read up idle </proc/uptime
35
+echo "[$up] Hello and goodbye from inside $0"
36
+poweroff
37
+END_RC_LOCAL
38
+chmod 755 $rclocal
39
+EOF
40
fi
41
42
cloud-localds -d qcow2 seed.img user-data meta-data
0 commit comments