[arch-general] [PATCH 25/48] Bashify poweroff or reboot code in rc.shutdown.

Victor Lowther victor.lowther at gmail.com
Wed Jun 30 17:47:44 EDT 2010


---
 rc.shutdown |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/rc.shutdown b/rc.shutdown
index b7b7d45..7d5ec26 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -108,15 +108,14 @@ stat_done
 run_hook shutdown_poweroff
 
 # Power off or reboot
-if [ "$RUNLEVEL" = "0" ]; then
-	printsep
+printsep
+if [[ $RUNLEVEL = 0 ]]; then
 	printhl "${C_H2}POWER OFF"
 	/sbin/poweroff -d -f -h -i
 else
-	printsep
 	printhl "${C_H2}REBOOTING"
 	# if kexec is installed and a kernel is loaded, use it
-	[ -x /sbin/kexec ] && /sbin/kexec -e > /dev/null 2>&1
+	[[ -x /sbin/kexec ]] && /sbin/kexec -e > /dev/null 2>&1
 	/sbin/reboot -d -f -i
 fi
 
-- 
1.7.1



More information about the arch-general mailing list