Skip to content

Commit 2a43afd

Browse files
author
Andi Gutmans
committed
Sooner than you think, Sascha :)
1 parent 5fc8562 commit 2a43afd

File tree

4 files changed

+94
-0
lines changed

4 files changed

+94
-0
lines changed

scripts/apache/apconf-conv.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
if [ "$1" = "" ]; then
4+
echo "Usage: $0 /somewhere/httpd.conf"
5+
exit 1
6+
fi
7+
8+
if [ ! -w $1 ]; then
9+
echo "You cannot write to $1"
10+
exit 1
11+
fi
12+
13+
TMPFILE=tmpfile.$$
14+
15+
awk -f conffix.awk <$1 >$TMPFILE
16+
17+
if [ "$?" != 0 ]; then
18+
exit 1
19+
fi
20+
21+
mv -f $1 $1.orig
22+
mv -f $TMPFILE $1
23+
exit 0
24+

scripts/apache/aphtaccess-conv.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
if [ "$1" = "" ]; then
4+
echo "Usage: $0 /somewhere/.htaccess"
5+
exit 1
6+
fi
7+
8+
if [ ! -w $1 ]; then
9+
echo "You cannot write to $1"
10+
exit 1
11+
fi
12+
13+
TMPFILE=tmpfile.$$
14+
15+
awk -f htaccessfix.awk <$1 >$TMPFILE
16+
17+
if [ "$?" != 0 ]; then
18+
exit 1
19+
fi
20+
21+
mv -f $1 $1.orig
22+
mv -f $TMPFILE $1
23+
exit 0
24+

scripts/apache/conffix.awk

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# $Id$
2+
3+
/php3_*/ {
4+
phpcommand=substr($1,6)
5+
phpvalue=tolower($2)
6+
print "<IfModule mod_php3.c>"
7+
print $1 $2
8+
print "</IfModule>"
9+
print "<IfModule mod_php4.c>"
10+
if (phpvalue=="on") {
11+
print "php_admin_flag " phpcommand " on"
12+
} else if (phpvalue=="off") {
13+
print "php_admin_flag " phpcommand " off"
14+
} else {
15+
print "php_admin_value " phpcommand " " substr($0,index($0,$1)+length($1)+1)
16+
}
17+
print "</IfModule>"
18+
}
19+
20+
! /php3_*/ {
21+
print $0
22+
}
23+

scripts/apache/htaccessfix.awk

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# $Id$
2+
3+
/php3_*/ {
4+
phpcommand=substr($1,6)
5+
phpvalue=tolower($2)
6+
print "<IfModule mod_php3.c>"
7+
print $1 $2
8+
print "</IfModule>"
9+
print "<IfModule mod_php4.c>"
10+
if (phpvalue=="on") {
11+
print "php_flag " phpcommand " on"
12+
} else if (phpvalue=="off") {
13+
print "php_flag " phpcommand " off"
14+
} else {
15+
print "php_value " phpcommand " " substr($0,index($0,$1)+length($1)+1)
16+
}
17+
print "</IfModule>"
18+
}
19+
20+
! /php3_*/ {
21+
print $0
22+
}
23+

0 commit comments

Comments
 (0)