summaryrefslogtreecommitdiffstats
path: root/build_tools/archiso/archiso/archiso_shutdown
diff options
context:
space:
mode:
Diffstat (limited to 'build_tools/archiso/archiso/archiso_shutdown')
-rw-r--r--build_tools/archiso/archiso/archiso_shutdown33
1 files changed, 33 insertions, 0 deletions
diff --git a/build_tools/archiso/archiso/archiso_shutdown b/build_tools/archiso/archiso/archiso_shutdown
index 85cce59..e61b7f9 100644
--- a/build_tools/archiso/archiso/archiso_shutdown
+++ b/build_tools/archiso/archiso/archiso_shutdown
@@ -32,6 +32,39 @@ if [[ ! -d /oldrun/archiso/copytoram ]]; then
fi
fi
+
+#JM
+#This is where the reboot would go
+echo "------------------------"
+#bootdev is created in rc.local on startup
+bootdev=$( cat /bootdev.txt )
+if [ -f /proc/sys/dev/cdrom/info ]
+then
+ cdroms=$( cat /proc/sys/dev/cdrom/info | { while read a b c; do
+ #echo $a $b $c
+ if [ "${a}" = "drive" -a "${b}" = "name:" ]; then
+ echo ${c}
+ break
+ fi
+ done
+ } )
+ for d in ${cdroms}
+ do
+ if [ "/dev/${d}" = "${bootdev}" ]
+ then
+ echo "Boot device is a cdrom, ejecting..."
+ eject ${bootdev}
+ break
+ fi
+ done
+fi
+echo "------------------------"
+sleep 1
+#
+
+
+
+
# reboot / poweroff / halt, depending on the argument passed by init
# if something invalid is passed, we halt
case "$1" in