madwifi: only start hostapd when necessary
[openwrt.git] / include / shell.sh
index 6ee0cf6..f6be6c5 100644 (file)
@@ -13,3 +13,22 @@ isset() {
        eval "var=\"\${$1}\""
        [ -n "$var" ]
 }
+
+trapret() {(
+       local retvals="$1"; shift
+       local cmd="$1"; shift
+       for retval in $(echo $retvals); do
+               local trap_$retval=1
+       done
+       "$cmd" "$@" || {
+               local retval="$?"
+               eval "trapped=\${trap_$retval}"
+               [ -n "$trapped" ] || {
+                       return $retval
+               }
+       }
+)}
+
+md5s() {
+       which md5sum 2>&1 >/dev/null && md5sum "$@" | awk '{print $1}' || md5 "$@"
+}
This page took 0.025227 seconds and 4 git commands to generate.