summaryrefslogtreecommitdiff
path: root/network/lldpd/rc.lldpd
blob: 023173b6c1c79448a2cc582a295f169a53236cf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

mkdir -p /run/lldpd

lldpd_start() {
  /usr/sbin/lldpd >/dev/null 2>&1
}

lldpd_stop() {
  killall lldpd
}

restart() {
  lldpd_stop
  sleep 1
  lldpd_start
}

case "$1" in
  'start')
    lldpd_start
  ;;
  'stop')
    lldpd_stop
  ;;
  'restart')
    lldpd_restart
  ;;
  *)
    echo "Usage: $0 start|stop|restart"
  ;;
esac