improve readability of ifplugd.action
$1 and $2 are easily mistaken and are not documented in the header
of the file. Assigning clear variable names improved readability and
makes it easier to change the script.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
--- conf/ifplugd.action.orig 2010-05-30 21:12:30.251833801 +0100
+++ conf/ifplugd.action 2010-05-30 21:14:11.601958801 +0100
@@ -19,12 +19,15 @@
set -e
-if [ -z "$1" ] || [ -z "$2" ] ; then
+NETDEV="$1"
+ACTION="$2"
+
+if [ -z "$NETDEV" ] || [ -z "$ACTION" ] ; then
echo "Wrong arguments" > /dev/stderr
exit 1
fi
-[ "$2" = "up" ] && exec /sbin/ifup $1
-[ "$2" = "down" ] && exec /sbin/ifdown $1
+[ "$ACTION" = "up" ] && exec /sbin/ifup "$NETDEV"
+[ "$ACTION" = "down" ] && exec /sbin/ifdown "$NETDEV"
exit 1