mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Add wifi toggle for kobos
This commit is contained in:
1
Makefile
1
Makefile
@@ -126,6 +126,7 @@ koboupdate: all
|
||||
cp kobo/koreader.sh $(INSTALL_DIR)/koreader
|
||||
cp kobo/suspend.sh $(INSTALL_DIR)/koreader
|
||||
cp kobo/nickel.sh $(INSTALL_DIR)/koreader
|
||||
cp kobo/wifi.sh $(INSTALL_DIR)/koreader
|
||||
# create new package
|
||||
cd $(INSTALL_DIR) && \
|
||||
zip -9 -r \
|
||||
|
||||
@@ -22,7 +22,7 @@ function NetworkMgr:turnOnWifi()
|
||||
if Device:isKindle() then
|
||||
kindleEnableWifi(1)
|
||||
elseif Device:isKobo() then
|
||||
-- TODO: turn on wifi on kobo?
|
||||
os.execute("./wifi.sh on")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@ function NetworkMgr:turnOffWifi()
|
||||
if Device:isKindle() then
|
||||
kindleEnableWifi(0)
|
||||
elseif Device:isKobo() then
|
||||
-- TODO: turn off wifi on kobo?
|
||||
os.execute("./wifi.sh off")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
23
kobo/wifi.sh
Normal file
23
kobo/wifi.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
export PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
case $1 in
|
||||
on )
|
||||
for mod in sdio_wifi_pwr dhd; do
|
||||
insmod /drivers/ntx508/wifi/${mod}.ko 2>/dev/null
|
||||
done
|
||||
sleep 1
|
||||
ifconfig eth0 up
|
||||
wlarm_le -i eth0 up
|
||||
wpa_supplicant -s -i eth0 -c /etc/wpa_supplicant/wpa_supplicant.conf -C /var/run/wpa_supplicant -B
|
||||
sleep 1
|
||||
udhcpc -S -i eth0 -s /etc/udhcpc.d/default.script -t15 -T10 -A3 -b -q >/dev/null 2>&1 &
|
||||
;;
|
||||
off )
|
||||
killall wpa_supplicant 2>/dev/null
|
||||
wlarm_le -i eth0 down
|
||||
ifconfig eth0 down
|
||||
rmmod -r dhd
|
||||
rmmod -r sdio_wifi_pwr
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user