gre: add different per-protocol prefixes to GRE-TAP IPv4/6 tunnel interfaces.
[openwrt/openwrt.git] / include / shell.sh
index 1e60692b97fffcc1864146345da6b761cbe6c3f7..8f6f6f04bb414e5dc24851d6dceefe8d282782f4 100644 (file)
@@ -14,17 +14,9 @@ isset() {
        [ -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() {
+       cat "$@" | (
+               md5sum 2>/dev/null ||
+               md5
+       ) | awk '{print $1}'
+}