#!/bin/sh DAEMON=aiccu . /etc/init.d/modlibrc config() { modlib_config } start() { #aiccu needs correct date, wait for it local counter=$AICCU_WAITTIME while [ `date +%Y` -lt 2010 -a $counter -gt 0 ]; do let counter-- sleep 1 done if [ `date +%Y` -lt 2010 -a "$AICCU_WAITTIME" -gt 0 ]; then echo "Starting of ${DAEMON} aborted. Time is not synchronized, failed." exit 1 fi # try to load kernel module [ -d /proc/sys/net/ipv6 ] || modprobe ipv6 2>/dev/null modlib_startdaemon $DAEMON start /mod/etc/$DAEMON.conf retval=$? local _timer=30 while [ $_timer -gt 0 ]; do let _timer-- if ifconfig ${AICCU_INTERFACE} >/dev/null 2>&1; then echo 0 2>/dev/null >/proc/sys/net/ipv6/conf/${AICCU_INTERFACE}/disable_ipv6 break fi sleep 1 done if [ "$AICCU_RUNSCRIPT" == "yes" ]; then /tmp/flash/aiccu/aiccu.sh $AICCU_INTERFACE [ "$?" -ne 0 ] && retval=$? fi return $retval } stop () { $DAEMON stop /mod/etc/$DAEMON.conf } case $1 in ""|load) modreg cgi 'aiccu' 'aiccu' modreg daemon $DAEMON modlib_start $AICCU_ENABLED ;; unload) modunreg daemon $DAEMON modunreg cgi 'aiccu' modlib_stop ;; start) modlib_start ;; stop) modlib_stop ;; restart) modlib_restart ;; status) modlib_status ;; *) echo "Usage: $0 [load|unload|start|stop|restart|status]" 1>&2 exit 1 ;; esac exit 0