FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 06-30-2010, 09:47 PM
Victor Lowther
 
Default Clean up entropy pool saving and system clock saving.

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

Thread Tools




All times are GMT. The time now is 09:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org