cbowlby/resource-agents — Issue #3: Clear bashisms from dhcpd script
Author: cbowlby
Created: 2011-12-02 19:24:59+00:00
State: open

checkbashism is reporting a number of bash specific code, and alternatives should be found to remove the requirement on bash, and stick with the sh requirement that seems to be fairly standard in the resource agents:

possible bashism in dhcpd line 311 (brace expansion):
for i in /etc/{gai.conf,nsswitch.conf,resolv.conf,host.conf,hosts,localtime} /dev/urandom; do
possible bashism in dhcpd line 321 (read with option other than -r):
/usr/bin/ldd "$1" | while read -sr a b c d ; do
possible bashism in dhcpd line 323 (alternative test command ([[ foo ]] should be [ foo ])):
[[ $c =~ $ldd_wl ]] || continue
possible bashism in dhcpd line 324 (alternative test command ([[ foo ]] should be [ foo ])):
[[ $c =~ $ldd_bl ]] && continue
possible bashism in dhcpd line 331 (brace expansion):
cplibs=`for i in /$libdir/{libresolv.so.*,libnss_*.so.*} /$libdir/{libpthread.so.0,libdl.so.2} ;
possible bashism in dhcpd line 351 ('$(< foo)' should be '$(cat foo)'):
i=$(<${OCF_RESKEY_dhcpd_chrooted_path}/${OCF_RESKEY_dhcpd_pidfile})
possible bashism in dhcpd line 352 (should be >word 2>&1):
if pidof dhcpd &>/dev/null; then
possible bashism in dhcpd line 408 (kill -[0-9] or -[A-Z]):
kill -9 `cat ${OCF_RESKEY_dhcpd_chrooted_path}/${OCF_RESKEY_dhcpd_pidfile}`