Created
November 1, 2017 19:28
-
-
Save dave-kennedy/e37e3033564156fcf3068de21b2afd43 to your computer and use it in GitHub Desktop.
CGI form
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
#!/bin/sh | |
read input | |
if [ -n "$input" -a "$input" = 'password=foobar' ]; then | |
echo -e 'Content-Type: text/html\n' | |
cat << EOF | |
<html> | |
<body>Rebooting...</body> | |
</html> | |
EOF | |
reboot | |
exit 0 | |
fi | |
echo -e 'Content-Type: text/html\n' | |
cat << EOF | |
<html> | |
<body> | |
<form method="post"> | |
<label> | |
Password: <input name="password" type="text"> | |
</label> | |
<input type="submit" value="Submit"> | |
</form> | |
</body> | |
</html> | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment