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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



---
 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



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux