--- /dev/null
+#!/bin/sh
+
+# Print usage
+if [ "$#" -eq 0 ] || [ "$1" == "-h" ]; then
+ echo "This is a simple script that change the pre-shared key of a router"
+ echo "using UCI command change password written in /etc/config/wireless"
+ echo ""
+ echo "Usage:"
+ echo " ./change_default_pw.sh [-h]"
+ echo " ./change_default_pw.sh [-ch <specific_password>]"
+ echo ""
+ echo "Options:"
+ echo " -h show this usage"
+ echo " -ch change default into a specific password"
+ echo ""
+
+elif [ "$1" == "-ch" ]; then
+ # Change the wireless.key option in the config file.
+ PW=$2
+ uci set wireless.default_radio0.key=$PW
+ uci set wireless.default_radio1.key=$PW
+ uci commit
+ /sbin/wifi
+
+else
+ echo "Unknown option. Please run ./change_default_pw.sh -h for usage."
+fi