-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added password protection to DDWRT-BWMON to activate password protect…
…ion use the script set-password.sh
- Loading branch information
Showing
9 changed files
with
330 additions
and
146 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
SCRIPT_DIR=$(dirname ${0}) | ||
SCRIPT_DIR=$(cd ${SCRIPT_DIR} && pwd) | ||
|
||
# Create folder that the password file lives in | ||
if [ ! -d $SCRIPT_DIR/data ] | ||
then | ||
mkdir $SCRIPT_DIR/data | ||
fi | ||
|
||
echo 'Please type your password below or leave blank and press enter for no password (default).' | ||
|
||
read password | ||
if [ "$password" = "" ] | ||
then | ||
echo "Password has been cleared." | ||
printf "window.serverPasswordHash='';\n" > $SCRIPT_DIR/data/password.js | ||
else | ||
SHA256HASH_RAW=$(printf "$password" | openssl dgst -sha256) | ||
SHA256HASH=${SHA256HASH_RAW:9} | ||
printf "window.serverPasswordHash='$SHA256HASH';\n" > $SCRIPT_DIR/data/password.js | ||
echo 'Your selected password has been set.' | ||
fi | ||
|
||
echo 'Please restart the server for your changes to take effect.' |
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 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.