summaryrefslogtreecommitdiff
path: root/network/lldpd/rc.lldpd
blob: 40d75680da3d74d5f14f525bf8be11f2d88c616c (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
}

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