Renaming Sentinel to Vigilia; adjusting scripts; adding brctl option in menuconfig...
[lede.git] / vigilia_setup / register / version_2 / change_default_pw.sh
1 #!/bin/sh
2
3 # Print usage
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"
7         echo ""
8         echo "Usage:"
9         echo "  ./change_default_pw.sh [-h]"
10         echo "  ./change_default_pw.sh [-ch <specific_password>]"
11         echo ""
12         echo "Options:"
13         echo "  -h      show this usage"
14         echo "  -ch     change default into a specific password"
15         echo ""
16
17 elif [ "$1" == "-ch" ]; then
18         # Change the wireless.key option in the config file.
19         PW=$2
20         uci set wireless.default_radio0.key=$PW
21         uci set wireless.default_radio1.key=$PW
22         uci commit
23         /sbin/wifi
24
25 else
26         echo "Unknown option. Please run ./change_default_pw.sh -h for usage."
27 fi