#!/bin/sh
. /etc/utils/shell-utils.sh

if [ "$1" == "active" ]; then
    tmp=`cat /sys/class/leds/red/level`
    echo $tmp > /sys/class/leds/red/level_off
    echo 0 > /sys/class/leds/mag-front-led/brightness
else
    isNfsMount NFS_MOUNT
    if [ "${NFS_MOUNT}" == "n" ]; then
        ifdown eth0
    fi

    ifdown wlan0
    /etc/init.d/wifi_deinit.sh

    if [ -f /ram/wifi_wa_disabled ]; then
        rm /ram/wifi_wa_disabled;
    fi

# Workaround for multicast issues (Issue 18107 && 25338)
sleep 2

fi
sync