[PATCH 23/48] Clean up entropy pool saving and system clock saving.

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



---
 rc.shutdown |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/rc.shutdown b/rc.shutdown
index cc39030..b2278b6 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -27,8 +27,8 @@ RANDOM_SEED=/var/lib/misc/random-seed
 : > $RANDOM_SEED
 /bin/chmod 0600 $RANDOM_SEED
 POOL_FILE=/proc/sys/kernel/random/poolsize
-if [ -r $POOL_FILE ]; then
-	POOL_SIZE=$(/bin/cat $POOL_FILE)
+if [[ -r $POOL_FILE ]]; then
+	read POOL_SIZE <$POOL_FILE
 else
 	POOL_SIZE=512
 fi
@@ -36,22 +36,18 @@ fi
 stat_done
 
 stat_busy "Saving System Clock"
-if [ "$TIMEZONE" != "" -a -e "/usr/share/zoneinfo/$TIMEZONE" ]; then
+if [[ $TIMEZONE && -e /usr/share/zoneinfo/$TIMEZONE ]]; then
 	/bin/rm -f /etc/localtime
 	/bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
 fi
 
 HWCLOCK_PARAMS="--systohc"
-if [ "$HARDWARECLOCK" = "UTC" ]; then
-	HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc"
-elif [ "$HARDWARECLOCK" = "localtime" ]; then
-	HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime"
-else
-	HWCLOCK_PARAMS=""
-fi
-if [ -n "$HWCLOCK_PARAMS" ]; then
-	/sbin/hwclock $HWCLOCK_PARAMS
-fi
+case $HARDWARECLOCK in 
+    UTC) HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc";;
+    localtime) HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime";;
+    *) HWCLOCK_PARAMS="";;
+esac
+[[ $HWCLOCK_PARAMS ]] && /sbin/hwclock $HWCLOCK_PARAMS
 stat_done
 
 # removing psmouse module to fix some reboot issues on newer laptops
-- 
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