forked from Xpndable/DotUI
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve tools, move wifi setup to wifi.pak
- Loading branch information
Showing
11 changed files
with
185 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
killall telnetd > /dev/null 2>&1 & | ||
killall ftpd > /dev/null 2>&1 & | ||
killall tcpsvd > /dev/null 2>&1 & | ||
killall wpa_supplicant > /dev/null 2>&1 | ||
killall udhcpc > /dev/null 2>&1 | ||
ifconfig wlan0 down | ||
|
||
ifconfig lo up | ||
ifconfig wlan0 up | ||
/customer/app/wpa_supplicant -B -D nl80211 -iwlan0 -c /appconfigs/wpa_supplicant.conf | ||
udhcpc -i wlan0 -s /etc/init.d/udhcpc.script > /dev/null 2>&1 & | ||
|
||
# Telnet | ||
if [ -f "$USERDATA_PATH/.wifi/telnet_on.txt" ] && [ -f "$TOOLS_PATH/Telnet.pak/launch.sh" ]; then | ||
(cd / && telnetd -l sh) | ||
fi | ||
|
||
# FTP | ||
if [ -f "$USERDATA_PATH/.wifi/ftp_on.txt" ] && [ -f "$TOOLS_PATH/FTP.pak/launch.sh" ]; then | ||
tcpsvd -E 0.0.0.0 21 ftpd -w /mnt/SDCARD > /dev/null 2>&1 & | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/sh | ||
|
||
DIR=$(dirname "$0") | ||
cd "$DIR" | ||
|
||
mkdir -p "$USERDATA_PATH/.wifi" | ||
|
||
WIFI_SSID="$(keyboard "Enter WiFi network name:" 32)" | ||
|
||
if [ $? -eq 0 ] && [ ! -z "$WIFI_SSID" ]; then | ||
show confirm.png | ||
say "WiFi network name set:"$'\n'"${WIFI_SSID:0:16}"$'\n'"${WIFI_SSID:17}" | ||
if confirm; then | ||
WIFI_PASS="$(keyboard "Enter WiFi network pass:" 63)" | ||
if [ $? -eq 0 ]; then | ||
show confirm.png | ||
if [ ! -z "$WIFI_PASS" ]; then | ||
say "WiFi network password set:"$'\n'"${WIFI_PASS:0:16}"$'\n'"${WIFI_PASS:17:16}"$'\n'"${WIFI_PASS:33:16}"$'\n'"${WIFI_PASS:48}" | ||
else | ||
say "WiFi network password set to empty" | ||
fi | ||
if confirm; then | ||
echo "ctrl_interface=/var/run/wpa_supplicant" > /appconfigs/wpa_supplicant.conf | ||
echo "update_config=1" >> /appconfigs/wpa_supplicant.conf | ||
echo $'\n'"network={" >> /appconfigs/wpa_supplicant.conf | ||
echo $'\tssid="'"$WIFI_SSID"$'"' >> /appconfigs/wpa_supplicant.conf | ||
if [ ! -z "$WIFI_PASS" ]; then | ||
echo $'\tpsk="'"$WIFI_PASS"$'"' >> /appconfigs/wpa_supplicant.conf | ||
else | ||
echo $'\t'"key_mgmt=NONE" >> /appconfigs/wpa_supplicant.conf | ||
fi | ||
echo "}" >> /appconfigs/wpa_supplicant.conf | ||
show okay.png | ||
if [ ! -f /appconfigs/wpa_supplicant.conf ]; then | ||
if [ -f "$USERDATA_PATH/.wifi/wifi_on.txt" ]; then | ||
LD_PRELOAD= ./wifioff.sh > /dev/null 2>&1 & | ||
fi | ||
say "Error:"$'\n'"Could not save WiFi network settings!" | ||
else | ||
if [ -f "$USERDATA_PATH/.wifi/wifi_on.txt" ]; then | ||
LD_PRELOAD= ./wifireload.sh > /dev/null 2>&1 & | ||
fi | ||
say "WiFi network settings saved." | ||
fi | ||
confirm only | ||
exit 0 | ||
fi | ||
fi | ||
fi | ||
fi | ||
|
||
show okay.png | ||
say "WiFi network settings"$'\n'"were not changed." | ||
confirm only |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.