Make kill-dhclient.sh more readable
PATCH 1/1 Make kill-dhclient.sh more readable
Checking for existing file is more readable than string comparison
---
modules.d/40network/kill-dhclient.sh +0 -0
@@ -1,5 +1,5 @@
#!/bin/sh
for f in /tmp/dhclient.*.pid; do
- [ "$f" != "/tmp/dhclient.*.pid" ] && kill $(cat $f)
+ [ -e $f ] && kill $(cat $f)
done
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 11 lines · Seewer Philippe
Checking for existing file is more readable than string comparison
---
modules.d/40network/kill-dhclient.sh +0
-0@@ -1,5 +1,5 @@ #!/bin/sh
Quoted 4 lines
for f in
/tmp/dhclient.*.pid; do
- [ "$f" != "/tmp/dhclient.*.pid" ] && kill $(cat $f)
+ [ -e $f ] && kill $(cat $f)
done
but it involves a disk access :)
for the sake of speed :) (not that it matters much here.. )
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 12 lines · Harald Hoyer
Quoted 11 lines · Seewer Philippe
Checking for existing file is more readable than string comparison
---
modules.d/40network/kill-dhclient.sh +0
-0@@ -1,5 +1,5 @@ #!/bin/sh
Quoted 7 lines
Quoted 4 lines
for f in
/tmp/dhclient.*.pid; do
- [ "$f" != "/tmp/dhclient.*.pid" ] && kill $(cat $f)
+ [ -e $f ] && kill $(cat $f)
donebut it involves a disk access :)
for the sake of speed :) (not that it matters much here.. )
To a ram disk. :)
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html