From 265989c6fce9523b46aa9020f241ab2450307aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 19 Dec 2009 15:57:03 +0200 Subject: Eliminate bunch of unnecessary stat calls and command invocations. --- rc.d/init.d/halt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'rc.d/init.d/halt') 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 -- cgit v1.2.1