diff options
author | Katze Miau <miaukatzemiau@priveasy.de> | 2011-12-11 16:45:08 (GMT) |
---|---|---|
committer | Katze Miau <miaukatzemiau@priveasy.de> | 2011-12-11 16:45:08 (GMT) |
commit | 65c39ba8336b9efc1d76350ae27a18da6d51d5f6 (patch) | |
tree | 153e9f49fb41e451c75b5a824f119cfab019db6e /files/common/www | |
parent | ee91359463ae23b2ebe5cb235c7e11d362be81c8 (diff) |
fsm inetable: change httpd instances in queen/ghost/robinson states
- update the redirection uhttpd config and www-root to redirect all
incoming request to a url specified by /tmp/redirection_target
- use this to implement robinson and splash redirection during
robinson and queen/ghost states, respectively
- change the service httpd to listen on the public IPv4 address
available on the mesh interface in those states.
Missing is the
- iptable based redirection
- already referenced /sbin/urlencode
Diffstat (limited to 'files/common/www')
-rwxr-xr-x | files/common/www/redirection/redirect | 13 | ||||
-rwxr-xr-x | files/common/www/service/cgi-bin/redirect | 8 |
2 files changed, 13 insertions, 8 deletions
diff --git a/files/common/www/redirection/redirect b/files/common/www/redirection/redirect new file mode 100755 index 0000000..41b4eef --- /dev/null +++ b/files/common/www/redirection/redirect @@ -0,0 +1,13 @@ +#!/bin/sh + +read url reftrans < /tmp/redirection_target +if [ -x "$reftrans" ]; then + url="$url$($reftrans "$HTTP_HOST$REQUEST_URI")" +fi +echo -e \ +"Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r +Pragma: no-cache\r +Expires: -1\r +Status: 302 Temporary Redirect\r +Location: $url\r +\r" diff --git a/files/common/www/service/cgi-bin/redirect b/files/common/www/service/cgi-bin/redirect deleted file mode 100755 index 9b417db..0000000 --- a/files/common/www/service/cgi-bin/redirect +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -echo -en "Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r\n" -echo -en "Pragma: no-cache\r\n" -echo -en "Expires: -1\r\n" -echo -en "Status: 302 Temporary Redirect\r\n" -echo -en "Location: http://"`uci get network.mesh.ipaddr`"/cgi-bin/splash?"`/bin/urlencode "$HTTP_HOST$REQUEST_URI"`"\r\n" -echo -en "\r\n" -exit 0 |