summaryrefslogtreecommitdiff
path: root/sysutils/webmin/files/patch-setup.sh
blob: 4146f59d04042e2fcb68fa431c8fa9e17be8a632 (plain) (blame)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
--- setup.sh.orig	2022-10-01 06:55:59 UTC
+++ setup.sh
@@ -13,6 +13,13 @@ if [ "$bootscript" = "" ]; then
 	bootscript="webmin"
 fi
 
+nostart="yes"
+nostop="yes"
+nochown="yes"
+nouninstall="yes"
+noperlpath="yes"
+atboot=0
+
 cd `dirname $0`
 if [ -x /bin/pwd ]; then
 	wadir=`/bin/pwd`
@@ -112,7 +119,7 @@ echo "you can just accept the defaults."
 echo ""
 envetcdir="$config_dir"
 if [ "$envetcdir" = "" ]; then
-	envetcdir=/etc/webmin
+	envetcdir=%%PREFIX%%/etc/webmin
 	envetcdirnotfound=1
 fi
 printf "Config file directory [$envetcdir]: "
@@ -120,7 +127,7 @@ if [ "$config_dir" = "" ]; then
 	read config_dir
 fi
 if [ "$config_dir" = "" ]; then
-	config_dir=/etc/webmin
+	config_dir=%%PREFIX%%/etc/webmin
 fi
 abspath=`echo $config_dir | grep "^/"`
 if [ "$abspath" = "" ]; then
@@ -214,7 +221,7 @@ if [ "$upgrading" = 1 ]; then
 	if [ $? != "0" ]; then
 		echo "logout=$config_dir/logout-flag" >> $config_dir/miniserv.conf
 	fi
-	
+
 	# Check for third-party modules in old version
 	if [ "$wadir" != "$oldwadir" ]; then
 		echo "Checking for third-party modules .."
@@ -231,7 +238,7 @@ if [ "$upgrading" = 1 ]; then
 else
 	# Config directory exists .. make sure it is not in use
 	ls $config_dir | grep -v rpmsave >/dev/null 2>&1
-	if [ "$?" = "0" -a "$config_dir" != "/etc/webmin" ]; then
+	if [ "$?" = "0" -a "$config_dir" != "%%PREFIX%%/etc/webmin" ]; then
 		echo "ERROR: Config directory $config_dir is not empty"
 		echo ""
 		exit 2
@@ -240,7 +247,7 @@ else
 	# Ask for log directory
 	envvardir="$var_dir"
 	if [ "$envvardir" = "" ]; then
-		envvardir=/var/webmin
+		envvardir=/var/db/webmin
 		envvardirnotfound=1
 	fi
 	printf "Log file directory [$envvardir]: "
@@ -248,7 +255,7 @@ else
 		read var_dir
 	fi
 	if [ "$var_dir" = "" ]; then
-		var_dir=/var/webmin
+		var_dir=/var/db/webmin
 	fi
 	abspath=`echo $var_dir | grep "^/"`
 	if [ "$abspath" = "" ]; then
@@ -305,7 +312,7 @@ else
 	fi
 	echo ""
 
-	# Test perl 
+	# Test perl
 	echo "Testing Perl .."
 	if [ ! -x $perl ]; then
 		echo "ERROR: Failed to find perl at $perl"
@@ -780,7 +787,7 @@ if [ -x "$systemctlcmd" ]; then
 
 	# Fix existing systemd webmin.service file to update start and stop commands
 	(cd "$wadir/init" ; WEBMIN_CONFIG=$config_dir WEBMIN_VAR=$var_dir "$wadir/init/updateboot.pl" "$bootscript")
-	
+
 	chmod 755 $config_dir/stop $config_dir/start $config_dir/restart $config_dir/restart-by-force-kill $config_dir/reload $config_dir/.pre-install $config_dir/.post-install
 else
 	# Creating symlinks
@@ -1053,5 +1060,3 @@ if [ "$oldwadir" != "$wadir" -a "$upgrading" = 1 -a "$
 	echo "version."
 	echo ""
 fi
-
-