Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73036ae
commit c373279
Showing
2 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
# check config exist | ||
wificfg="/mnt/sda1/trophy/wifi.cfg" | ||
|
||
if [ -f "$wificfg" ] | ||
then | ||
# load wifi config | ||
source "$wificfg" | ||
|
||
echo "Updating wifi settings:" | ||
echo " - SSID: $ssid" | ||
echo " - Key: $key" | ||
echo " - Encryption: $encryption" | ||
echo " " | ||
|
||
# apply to OpenWrt UCI | ||
# see: http://wiki.openwrt.org/doc/uci/wireless | ||
/sbin/uci "set" "wireless.@wifi-iface[0].ssid=$ssid" | ||
/sbin/uci "set" "wireless.@wifi-iface[0].key=$key" | ||
/sbin/uci "set" "wireless.@wifi-iface[0].encryption=$encryption" | ||
/sbin/uci commit wireless | ||
wifi | ||
else | ||
echo "$wificfg was not found. Leaving wifi alone." | ||
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,20 @@ | ||
# Enter your WiFi network information here. | ||
|
||
# Make sure each value comes between the double quotes, and that | ||
# there are no spaces on either side of the equals sign. | ||
|
||
# Your WiFi network name. This is case-sensitive. | ||
ssid="My Network Name" | ||
|
||
# Your WiFi network password. This is case-sensitive. | ||
key="password123" | ||
|
||
# Your WiFi network encryption method. Assuming you have this set | ||
# up at home, it is very unlikely you'll have to change this. | ||
# Possible options are: | ||
# psk - wpa personal | ||
# psk2 - wpa2 personal | ||
# wpa - wpa enterprise | ||
# wpa2 - wpa2 enterprise | ||
# none - unencrypted network | ||
encryption="psk2" |