diff options
author | Jimmy Olgeni <olgeni@FreeBSD.org> | 2022-10-01 10:15:05 +0200 |
---|---|---|
committer | Jimmy Olgeni <olgeni@FreeBSD.org> | 2022-10-01 10:34:28 +0200 |
commit | 5725ea1ced84beca8f9eb0481bc61d6af7214373 (patch) | |
tree | baa062659857829ee965ce19a0bd4a3117f8cbaa /sysutils/webmin/files/patch-setup.sh | |
parent | net/nats-server: update to version 2.9.2 (diff) |
sysutils/webmin: update to version 2.000
Diffstat (limited to 'sysutils/webmin/files/patch-setup.sh')
-rw-r--r-- | sysutils/webmin/files/patch-setup.sh | 159 |
1 files changed, 78 insertions, 81 deletions
diff --git a/sysutils/webmin/files/patch-setup.sh b/sysutils/webmin/files/patch-setup.sh index 17804bd1a726..4146f59d0404 100644 --- a/sysutils/webmin/files/patch-setup.sh +++ b/sysutils/webmin/files/patch-setup.sh @@ -1,97 +1,94 @@ ---- setup.sh.orig 2022-07-04 19:10:33 UTC +--- setup.sh.orig 2022-10-01 06:55:59 UTC +++ setup.sh -@@ -105,19 +105,7 @@ echo "Webmin uses separate directories for configurati - echo "Unless you want to run multiple versions of Webmin at the same time" - echo "you can just accept the defaults." +@@ -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 "" --printf "Config file directory [/etc/webmin]: " --if [ "$config_dir" = "" ]; then -- read config_dir --fi --if [ "$config_dir" = "" ]; then + 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 --fi --abspath=`echo $config_dir | grep "^/"` --if [ "$abspath" = "" ]; then -- echo "Config directory must be an absolute path" -- echo "" -- exit 2 --fi -+config_dir=/usr/local/etc/webmin - if [ ! -d $config_dir ]; then - mkdir $config_dir; - if [ $? != 0 ]; then -@@ -212,12 +200,12 @@ else ++ 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 -- printf "Log file directory [/var/webmin]: " -+ printf "Log file directory [/var/log/webmin]: " - if [ "$var_dir" = "" ]; then + 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/log/webmin ++ var_dir=/var/db/webmin fi abspath=`echo $var_dir | grep "^/"` if [ "$abspath" = "" ]; then -@@ -245,7 +233,9 @@ else - echo "Webmin is written entirely in Perl. Please enter the full path to the" - echo "Perl 5 interpreter on your system." - echo "" -- if [ -x /usr/bin/perl ]; then -+ if [ -x %%PERL%% ]; then -+ perldef=%%PERL%% -+ elif [ -x /usr/bin/perl ]; then - perldef=/usr/bin/perl - elif [ -x /usr/local/bin/perl ]; then - perldef=/usr/local/bin/perl -@@ -446,6 +436,7 @@ else - fi - fi - -+ atboot=0 - # Ask whether to run at boot time - if [ "$atboot" = "" ]; then - if echo "$os_type" | grep -q "\-linux$"; then -@@ -607,6 +598,7 @@ EOF +@@ -305,7 +312,7 @@ else fi - fi + echo "" -+noperlpath="yes" - if [ "$noperlpath" = "" ]; then - echo "Inserting path to perl into scripts.." - (find "$wadir" -name '*.cgi' -print ; find "$wadir" -name '*.pl' -print) | $perl "$wadir/perlpath.pl" $perl - -@@ -618,7 +610,6 @@ fi - echo "Creating start and stop init scripts.." - # Start main - echo "#!/bin/sh" >$config_dir/.start-init --echo "echo Starting Webmin server in $wadir" >>$config_dir/.start-init - echo "trap '' 1" >>$config_dir/.start-init - echo "LANG=" >>$config_dir/.start-init - echo "export LANG" >>$config_dir/.start-init -@@ -849,6 +840,7 @@ if [ "$?" != "0" ]; then - echo passdelay=1 >> $config_dir/miniserv.conf - fi +- # 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 -+nouninstall="yes" - if [ "$nouninstall" = "" ]; then - echo "Creating uninstall script $config_dir/uninstall.sh .." - cat >$config_dir/uninstall.sh <<EOF -@@ -886,6 +878,7 @@ for f in miniserv.conf miniserv.pem miniserv.users; do - chmod -R og-rw $config_dir/$f - done - chmod +r $config_dir/version -+nochown="yes" - if [ "$nochown" = "" ]; then - # Make program directory non-world-writable, but executable - chown -R root "$wadir" -@@ -938,6 +931,7 @@ if [ -r "$srcdir/setup-post.sh" ]; then - . "$srcdir/setup-post.sh" + # 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 - -+nostart="yes" - if [ "$nostart" = "" ]; then - if [ "$inetd" != "1" ]; then - echo "Attempting to start Webmin web server.." +- +- |