Commit 18f6008c authored by Kinga Wujek's avatar Kinga Wujek Committed by Kinga Wujek

rootfs/etc/init.d: fix indentation in lldpd.sh (no technical change)

Signed-off-by: 's avatarKinga Wujek <dev_public@wujek.eu>
parent aa75f368
...@@ -18,8 +18,8 @@ start_counter() { ...@@ -18,8 +18,8 @@ start_counter() {
COUNTER_FILE="/tmp/start_cnt_lldpd" COUNTER_FILE="/tmp/start_cnt_lldpd"
START_COUNTER=1 START_COUNTER=1
if [ -f "$COUNTER_FILE" ] ; then if [ -f "$COUNTER_FILE" ] ; then
read -r START_COUNTER < $COUNTER_FILE read -r START_COUNTER < $COUNTER_FILE
START_COUNTER=$((START_COUNTER+1)) START_COUNTER=$((START_COUNTER+1))
fi fi
echo "$START_COUNTER" > $COUNTER_FILE echo "$START_COUNTER" > $COUNTER_FILE
} }
...@@ -28,17 +28,17 @@ start() { ...@@ -28,17 +28,17 @@ start() {
echo -n "Starting lldpd: " echo -n "Starting lldpd: "
if [ -f $dotconfig ]; then if [ -f $dotconfig ]; then
. $dotconfig . $dotconfig
else else
echo "$0 unable to source dot-config ($dotconfig)!" echo "$0 unable to source dot-config ($dotconfig)!"
fi fi
if [ "$CONFIG_LLDPD_DISABLE" = "y" ]; then if [ "$CONFIG_LLDPD_DISABLE" = "y" ]; then
echo "lldpd disabled in dot-config!" echo "lldpd disabled in dot-config!"
if [ "$1" != "force" ]; then if [ "$1" != "force" ]; then
exit 0 exit 0
fi fi
echo -n "Force start of lldpd: " echo -n "Force start of lldpd: "
fi fi
# Creating lldpd config # Creating lldpd config
...@@ -48,38 +48,38 @@ start() { ...@@ -48,38 +48,38 @@ start() {
tx_interval=5 tx_interval=5
if [ ! -z "$CONFIG_LLDPD_TX_INTERVAL" ]; then if [ ! -z "$CONFIG_LLDPD_TX_INTERVAL" ]; then
tx_int=$CONFIG_LLDPD_TX_INTERVAL tx_int=$CONFIG_LLDPD_TX_INTERVAL
# check if given value is an int # check if given value is an int
case $tx_int in case $tx_int in
''|*[!0-9]*) echo -n "wrong CONFIG_LLDPD_TX_INTERVAL "$tx_int". Using 5 as the default interval. " ;; ''|*[!0-9]*) echo -n "wrong CONFIG_LLDPD_TX_INTERVAL "$tx_int". Using 5 as the default interval. " ;;
*) echo tx_interval=$tx_int ;; *) echo tx_interval=$tx_int ;;
esac esac
fi fi
echo "configure lldp tx-interval $tx_interval" >> $LLDPD_CONFIG echo "configure lldp tx-interval $tx_interval" >> $LLDPD_CONFIG
if [ "$CONFIG_LLDPD_MINIMUM_FRAME_SIZE" = "y" ]; then if [ "$CONFIG_LLDPD_MINIMUM_FRAME_SIZE" = "y" ]; then
echo "configure system description 'WR-SWITCH'" >> $LLDPD_CONFIG echo "configure system description 'WR-SWITCH'" >> $LLDPD_CONFIG
# disable capabilities-advertisements # disable capabilities-advertisements
echo "unconfigure ports all lldp capabilities-advertisements" >> $LLDPD_CONFIG echo "unconfigure ports all lldp capabilities-advertisements" >> $LLDPD_CONFIG
# disable management ip advertisements # disable management ip advertisements
echo "unconfigure ports all lldp management-addresses-advertisements" >> $LLDPD_CONFIG echo "unconfigure ports all lldp management-addresses-advertisements" >> $LLDPD_CONFIG
else else
echo "configure system description 'WR-SWITCH: $(/wr/bin/wrsw_version)'" >> $LLDPD_CONFIG echo "configure system description 'WR-SWITCH: $(/wr/bin/wrsw_version)'" >> $LLDPD_CONFIG
fi fi
if [ "$CONFIG_LLDPD_MANAGEMENT_PORT_DISABLE" = "y" ]; then if [ "$CONFIG_LLDPD_MANAGEMENT_PORT_DISABLE" = "y" ]; then
echo "configure system interface pattern '!eth*'" >> $LLDPD_CONFIG echo "configure system interface pattern '!eth*'" >> $LLDPD_CONFIG
fi fi
echo "resume" >> $LLDPD_CONFIG echo "resume" >> $LLDPD_CONFIG
start-stop-daemon -S -q -p /var/run/lldpd.pid --exec $LLDPD -- $LLDPD_OPT start-stop-daemon -S -q -p /var/run/lldpd.pid --exec $LLDPD -- $LLDPD_OPT
ret=$? ret=$?
if [ $ret -eq 0 ]; then if [ $ret -eq 0 ]; then
start_counter start_counter
echo "OK" echo "OK"
elif [ $ret -eq 1 ]; then elif [ $ret -eq 1 ]; then
echo "Failed (already running?)" echo "Failed (already running?)"
else else
echo "Failed" echo "Failed"
fi fi
} }
...@@ -87,9 +87,9 @@ stop() { ...@@ -87,9 +87,9 @@ stop() {
echo -n "Stopping lldpd: " echo -n "Stopping lldpd: "
start-stop-daemon -K -q -p /var/run/lldpd.pid start-stop-daemon -K -q -p /var/run/lldpd.pid
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "OK" echo "OK"
else else
echo "Failed" echo "Failed"
fi fi
} }
...@@ -99,16 +99,16 @@ restart() { ...@@ -99,16 +99,16 @@ restart() {
} }
case "$1" in case "$1" in
start) start)
start "$2" start "$2"
;;
stop)
stop
;; ;;
restart|reload) stop)
restart stop
;; ;;
*) restart|reload)
restart
;;
*)
echo "Usage: $0 {start <force>|stop|restart}" echo "Usage: $0 {start <force>|stop|restart}"
echo " start force -- enable lldpd even it is disabled in the dot-config" echo " start force -- enable lldpd even it is disabled in the dot-config"
exit 1 exit 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment