summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xauthenticate_session15
1 files changed, 14 insertions, 1 deletions
diff --git a/authenticate_session b/authenticate_session
index 8995080..4ff6ace 100755
--- a/authenticate_session
+++ b/authenticate_session
@@ -2,4 +2,17 @@
AUTH="'authenticated' => 'yes'"
-sed "s/\('_SESSION_REMOTE_ADDR'\)/$AUTH, \1/"
+replace_stream()
+{
+ sed "s/\('_SESSION_REMOTE_ADDR'\)/$AUTH, \1/"
+}
+
+if [ "$1" ];
+then
+ cd /tmp
+ mv "$1" "$1".unauthenticated
+ cat "$1".unauthenticated|replace_stream > "$1"
+ chown www-data.www-data "$1"
+else
+ replace_stream
+fi