File: bug-223309-modules-config.patch

package info (click to toggle)
wwwconfig-common 0.3.0
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 488 kB
  • sloc: sh: 952; makefile: 5
file content (42 lines) | stat: -rw-r--r-- 1,680 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- /usr/share/wwwconfig-common/apache-php.sh	2004-02-16 14:35:15.000000000 +0100
+++ apache-php.sh	2004-05-24 13:09:13.000000000 +0200
@@ -9,6 +9,8 @@
 #	        o / */[[:space:]]*/
 #	20020116 Ola Lundqvist <opal@debian.org>
 #		Documented the error variable.
+#       20040525 Jeremy Laine <jeremy.laine@m4x.org>
+#		Switched to modules-config.
 # Needs:	$phpver - the php version to use.
 #		$phpini - the php config file to use.
 #		$server - the apache server to use,
@@ -26,20 +28,16 @@
     error="No php ini file to check for."
 elif [ ! -f $phpini ] ; then
     error="Php config file $phpini not found."
+elif [ -z $(which modules-config) ] ; then
+    error="Could not find modules-config."
 else
-    phpverm=$phpver"_module"
-    if grep -e "^[[:space:]]*#[[:space:]]*LoadModule[[:space:]]\+$phpverm" /etc/$server/httpd.conf > /dev/null 2>&1; then
-		# Uncommenting
-	sed -e "s#\([[:space:]]*\)\#[[:space:]]\+\(LoadModule $phpverm\)#\1\2#" /etc/$server/httpd.conf > /etc/$server/httpd.conf.tmp
-	status=uncomment
-	if grep -e "^[[:space:]]*LoadModule[[:space:]]\+$phpverm" /etc/$server/httpd.conf.tmp >/dev/null 2>&1; then
-			# Uncomment successful.
-	    cp /etc/$server/httpd.conf /etc/$server/httpd.conf.back >/dev/null 2>&1
-	    mv /etc/$server/httpd.conf.tmp /etc/$server/httpd.conf
-	else
-			# Uncomment unsuccessful.
-	    status=error
-	    rm /etc/$server/httpd.conf.tmp
-	fi
+    phpverm="mod_"$phpver
+    phpstatus=`modules-config $server query $phpverm || true`
+    if [ -z "$phpstatus" ] ; then
+        modules-config $server enable $phpverm
+        # Uncomment successful.
+        status=uncomment
+    else
+        status=nothing
     fi
 fi