diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2009-12-19 16:13:21 +0200 |
---|---|---|
committer | Petr Lautrbach <plautrba@redhat.com> | 2010-12-06 15:32:03 +0100 |
commit | e2f34b7d86738a1413abd4b93fa7294bf115ab60 (patch) | |
tree | 78b00613621959e1f737762fa1457f51c972058b /rc.d/init.d | |
parent | a14d34e722acc6f9eb01b56f96032e9704ceed99 (diff) | |
download | initscripts-e2f34b7d86738a1413abd4b93fa7294bf115ab60.tar initscripts-e2f34b7d86738a1413abd4b93fa7294bf115ab60.tar.gz initscripts-e2f34b7d86738a1413abd4b93fa7294bf115ab60.tar.bz2 initscripts-e2f34b7d86738a1413abd4b93fa7294bf115ab60.tar.xz initscripts-e2f34b7d86738a1413abd4b93fa7294bf115ab60.zip |
Simplify various string match constructs. (#558575)
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-x | rc.d/init.d/halt | 2 | ||||
-rw-r--r-- | rc.d/init.d/netconsole | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 547e61b2..8bdf0346 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -116,7 +116,7 @@ tmpfs=$(awk '$2 ~ /^\/($|proc|dev)/ { next; } if [ -n "$SWAPS" ]; then action $"Turning off swap: " swapoff $SWAPS for dst in $SWAPS; do - if [[ "$dst" =~ ^/dev/mapper ]] \ + if [[ "$dst" == /dev/mapper* ]] \ && [ "$(dmsetup status "$dst" | cut -d ' ' -f 3)" = crypt ]; then backdev=$(/sbin/cryptsetup status "$dst" \ | awk '$1 == "device:" { print $2 }') diff --git a/rc.d/init.d/netconsole b/rc.d/init.d/netconsole index 17296f8e..7f91a6c6 100644 --- a/rc.d/init.d/netconsole +++ b/rc.d/init.d/netconsole @@ -47,7 +47,7 @@ print_address_info () [ -z "$DEV" ] && DEV=$(echo $route | sed "s|.* dev \([^ ]*\).*|\1|") echo "DEV=$DEV" echo "LOCALADDR=$(echo $route | sed "s|.* src \([^ ]*\).*|\1|")" - if echo $route | grep -q " via " ; then + if [[ $route == *" via "* ]] ; then via=$(echo $route | sed "s|.* via \([^ ]*\).*|\1|") target=$via else |