#!/bin/sh


BT_PROC_FILE=/proc/bt_sw
WIFI_PROC_FILE=/proc/wlan_sw
BT_STORE_FILE=/etc/btstate
WIFI_STORE_FILE=/etc/wifistate

if [ -f $WIFI_STORE_FILE ]
then 
	cat $WIFI_STORE_FILE > $WIFI_PROC_FILE
fi

if [ -f $BT_STORE_FILE ] ; then 
  if [ `cat $BT_STORE_FILE` -eq 1 ] ; then
    if [ `cat $BT_PROC_FILE` -eq 0 ] ; then
	cat $BT_STORE_FILE > $BT_PROC_FILE
    fi
  else
    cat $BT_STORE_FILE > $BT_PROC_FILE
  fi
fi
