blob: bf315747cea5c72d6468323efb6b3c401a576197 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#!/bin/sh
2#
3# This script is called with the following parameters:
4# interface tty speed local-address remote-address ipparam
5#
6
7
8# Kill the router advertisement daemon on this interface.
9# The killing procedure is copied from RedHat 6.0 initscripts.
10
11DEVICE="$1"
12
13PIDFILE="/var/run/radvd-$DEVICE.pid"
14
15[ -f "$PIDFILE" ] || exit 0
16
17PID="$(cat "$PIDFILE")"
18if [ "$PID" != "" ]; then
19 if ps h "$PID" >/dev/null 2>&1; then
20 kill -TERM "$PID"
21 usleep 10000
22 if ps h "$PID" >/dev/null 2>&1; then
23 sleep 1
24 if ps h "$PID" >/dev/null 2>&1; then
25 kill -KILL "$PID"
26 fi
27 fi
28 fi
29fi
30
31rm -f "$PIDFILE"