Add missing dependency on openssl to openflow-pki.
[sliver-openvswitch.git] / debian / openflow-switch.init
index 3dbfb9d..323c7f8 100755 (executable)
@@ -225,7 +225,17 @@ case "$1" in
             if test "$SWITCH_IP" = dhcp; then
                 must_succeed "Temporarily disabling of0" ifconfig of0 down
             else
-                must_succeed "Configuring of0 as $SWITCH_IP" ifconfig of0 $SWITCH_IP
+                COMMAND="ifconfig of0 $SWITCH_IP"
+                if test -n "$SWITCH_NETMASK"; then
+                    COMMAND="$COMMAND netmask $SWITCH_NETMASK"
+                fi
+                must_succeed "Configuring of0: $COMMAND" $COMMAND
+                if test -n "$SWITCH_GATEWAY"; then
+                    # This can fail because the route already exists,
+                    # so we don't insist that it succeed.
+                    COMMAND="route add default gw $SWITCH_GATEWAY"
+                    check_op "Adding default route: $COMMAND" $COMMAND
+                fi
             fi
         else
             must_succeed "Disabling of0" ifconfig of0 down
@@ -248,8 +258,8 @@ case "$1" in
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --pidfile $PIDFILE \
            --exec $DAEMON -- nl:0 $CONTROLLER --detach --pidfile=$PIDFILE \
-            --verbose=ANY:console:emer $DAEMON_OPTS $MGMT_OPTS $SSL_OPTS \
-            "$COMMAND_OPT"
+            --verbose=ANY:console:emer --verbose=ANY:syslog:err --log-file \
+            $DAEMON_OPTS $MGMT_OPTS $SSL_OPTS "$COMMAND_OPT"
         if running; then
             echo "$NAME."
         else