diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2009-12-19 15:57:03 +0200 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2010-01-12 17:09:10 -0500 |
commit | 265989c6fce9523b46aa9020f241ab2450307aa4 (patch) | |
tree | 168538aa78bb8280848af13978f56fef5caf2c05 /rc.d/init.d/halt | |
parent | d4c58cd1c84f99030c3f4778d2c64377838e0634 (diff) | |
download | initscripts-265989c6fce9523b46aa9020f241ab2450307aa4.tar initscripts-265989c6fce9523b46aa9020f241ab2450307aa4.tar.gz initscripts-265989c6fce9523b46aa9020f241ab2450307aa4.tar.bz2 initscripts-265989c6fce9523b46aa9020f241ab2450307aa4.tar.xz initscripts-265989c6fce9523b46aa9020f241ab2450307aa4.zip |
Eliminate bunch of unnecessary stat calls and command invocations.
Diffstat (limited to 'rc.d/init.d/halt')
-rwxr-xr-x | rc.d/init.d/halt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 8cb437fc..94d4fb08 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -78,7 +78,7 @@ esac # Find mdmon pid's and omit killing them OMITARGS= for i in /dev/.mdadm/*.pid; do - if [ "$i" = "mdadm.pid" -o ! -r "$i" ]; then + if [ "$i" = "mdadm.pid" ] || [ ! -r "$i" ]; then continue fi OMITARGS="$OMITARGS -o $(cat $i)" @@ -95,7 +95,7 @@ fi /sbin/halt -w # Save mixer settings, here for lack of a better place. -if [ -s /etc/alsa/alsactl.conf -a -x /sbin/alsactl -a -w /etc/asound.state ]; then +if [ -s /etc/alsa/alsactl.conf ] && [ -x /sbin/alsactl ] && [ -w /etc/asound.state ]; then action $"Saving mixer settings" /sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --ignore store fi @@ -188,12 +188,12 @@ elif [ -f /forcefsck ]; then fi # Shutdown UPS drivers -if [ "$command" = /sbin/halt -a -f /etc/sysconfig/ups ]; then +if [ "$command" = /sbin/halt ] && [ -f /etc/sysconfig/ups ]; then . /etc/sysconfig/ups if [ -z $POWERDOWNFLAG ]; then POWERDOWNFLAG=/etc/killpower fi - if [ "$SERVER" = "yes" -a -f $POWERDOWNFLAG ]; then + if [ "$SERVER" = "yes" ] && [ -f $POWERDOWNFLAG ]; then /sbin/upsdrvctl shutdown fi fi |