Skip to contentSkip to conversation

Make kill-dhclient.sh more readable

PATCH In review Seewer Philippe 3 participants 3 messages Jun 5, 2009 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

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
index 19f258a..fcebd32 100755
@@ -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]

#2 lore raw
Quoted 11 lines · Seewer Philippe

Checking for existing file is more readable than string comparison

---

modules.d/40network/kill-dhclient.sh +0 -0
index 19f258a..fcebd32 100755
@@ -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]

#4 lore raw
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
index 19f258a..fcebd32 100755
@@ -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)
done

but 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