]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
network: Made config command for stp.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 24 May 2009 15:35:33 +0000 (17:35 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 24 May 2009 15:35:33 +0000 (17:35 +0200)
src/network/lib/hooks/stp

index 7b795edb2d9823b551aacab12ab207ee355e9389..05c04e18cd32c04c21159acabc7243aca018a442 100644 (file)
@@ -39,7 +39,40 @@ case "${1}" in
                ;;
 
        config)
-               : # TODO
+               shift 2
+               while [ $# -gt 0 ]; do
+                       case "$1" in
+                               --ageing=*)
+                                       AGEING=${1#--ageing=}
+                                       ;;
+                               --priority=*)
+                                       PRIORITY=${1#--priority=}
+                                       ;;
+                               --delay=*)
+                                       DELAY=${1#--delay=}
+                                       ;;
+                               --hello=*)
+                                       HELLO=${1#--hello=}
+                                       ;;
+                               --maxage=*)
+                                       MAXAGE=${1#--maxage=}
+                                       ;;
+                               *)
+                                       echo "Unknown option: $1" >&2
+                                       exit 1
+                                       ;;
+                       esac
+                       shift
+               done
+               cat << EOF >> ${CONFIG_ZONES}/${zone}/stp
+HOOK=stp
+AGEING=$AGEING
+PRIORITY=$PRIORITY
+DELAY=$DELAY
+HELLO=$HELLO
+MAXAGE=$MAXAGE
+EOF
+               exit $?
                ;;
 
        *)