aboutsummaryrefslogtreecommitdiff
path: root/ipv6
diff options
context:
space:
mode:
authorOndřej Caletka <ondrej@caletka.cz>2014-11-30 18:55:28 +0100
committerOndřej Caletka <ondrej@caletka.cz>2014-12-01 15:15:35 +0100
commit7c9b5198cdcce3a79d389451206326eacdfc7f03 (patch)
tree7a72a9bdd3d9670f5e3b290e2e4e38c003431c57 /ipv6
parent4f7b0213d9d75391cc34636a2bcf302164aa410f (diff)
aiccu: Issue aiccu stop only when aiccu is running
When AICCU is not running, running 'aiccu stop' results in unnecessary communications with SixXS servers. Signed-off-by: Ondrej Caletka <Ondrej@Caletka.cz>
Diffstat (limited to 'ipv6')
-rwxr-xr-xipv6/aiccu/files/aiccu.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/ipv6/aiccu/files/aiccu.sh b/ipv6/aiccu/files/aiccu.sh
index 89c812219..38d8191f5 100755
--- a/ipv6/aiccu/files/aiccu.sh
+++ b/ipv6/aiccu/files/aiccu.sh
@@ -89,8 +89,12 @@ proto_aiccu_teardown() {
local cfg="$1"
local link="aiccu-$cfg"
CFGFILE="/var/etc/${link}.conf"
-
- aiccu stop "$CFGFILE"
+ PIDFILE="/var/run/${link}.pid"
+ [ -f "$CFGFILE" -a -f "$PIDFILE" ] && {
+ local pid="$(cat "$PIDFILE")"
+ [ -d /proc/$pid -a $(cat /proc/$pid/comm) = "aiccu" ] && \
+ aiccu stop "$CFGFILE"
+ }
}
proto_aiccu_init_config() {