When AICCU is not running, running 'aiccu stop' results in unnecessary
communications with SixXS servers.
Signed-off-by: Ondrej Caletka <Ondrej@Caletka.cz>
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() {