4 if [ "$#" -eq 0 ] || [ "$1" == "-h" ]; then
5 echo "This is a simple script that change the pre-shared key of a router"
6 echo "using UCI command change password written in /etc/config/wireless"
9 echo " ./change_default_pw.sh [-h]"
10 echo " ./change_default_pw.sh [-ch <specific_password>]"
13 echo " -h show this usage"
14 echo " -ch change default into a specific password"
17 elif [ "$1" == "-ch" ]; then
18 # Change the wireless.key option in the config file.
20 uci set wireless.default_radio0.key=$PW
21 uci set wireless.default_radio1.key=$PW
26 echo "Unknown option. Please run ./change_default_pw.sh -h for usage."