From 2b793e35d9c5132e8f1bc693623cdc3988a2884b Mon Sep 17 00:00:00 2001 From: Ilia Date: Tue, 19 Apr 2022 18:16:24 +0300 Subject: [PATCH] Avoid printing to STDOUT, print to `webmin-setup.out` when necessary --- makedebian.pl | 17 ++++++++--------- makerpm.pl | 17 ++++++----------- setup.sh | 1 + 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/makedebian.pl b/makedebian.pl index 278b317ac..6f7438829 100755 --- a/makedebian.pl +++ b/makedebian.pl @@ -351,8 +351,8 @@ read answer printf "\\n" if [ "\\\$answer" = "y" ]; then echo "Removing $ucproduct package .." - dpkg --remove $product - echo "Done!" + dpkg --remove --force-depends $product + echo ".. done" fi EOFF chmod +x /etc/$baseproduct/uninstall.sh @@ -366,15 +366,15 @@ if [ "\$?" = "0" ]; then fi fi if [ "\$sslmode" = "1" ]; then - echo "$ucproduct install complete. You can now login to https://\$host:\$port/" + echo "$ucproduct install complete. You can now login to https://\$host:\$port/" >>\$tempdir/$product-setup.out 2>&1 else - echo "$ucproduct install complete. You can now login to http://\$host:\$port/" + echo "$ucproduct install complete. You can now login to http://\$host:\$port/" >>\$tempdir/$product-setup.out 2>&1 fi if [ "$product" = "webmin" ]; then - echo "as root with your root password, or as any user who can use sudo" - echo "to run commands as root." + echo "as root with your root password, or as any user who can use sudo" >>\$tempdir/$product-setup.out 2>&1 + echo "to run commands as root." >>\$tempdir/$product-setup.out 2>&1 else - echo "as any user on the system." + echo "as any user on the system." >>\$tempdir/$product-setup.out 2>&1 fi EOF close(SCRIPT); @@ -390,8 +390,7 @@ if [ "\$1" != "upgrade" -a "\$1" != "abort-upgrade" ]; then # Package is being removed, and no new version of webmin # has taken it's place. Run uninstalls and stop the server if [ "$product" = "webmin" ]; then - echo "Running uninstall scripts .." - (cd /usr/share/$baseproduct ; WEBMIN_CONFIG=/etc/$baseproduct WEBMIN_VAR=/var/$baseproduct LANG= /usr/share/$baseproduct/run-uninstalls.pl) + (cd /usr/share/$baseproduct ; WEBMIN_CONFIG=/etc/$baseproduct WEBMIN_VAR=/var/$baseproduct LANG= /usr/share/$baseproduct/run-uninstalls.pl) >/dev/null 2>&1 /dev/null 2>&1 /etc/webmin/stop 2>/dev/null <<'EOD' #!/bin/sh -echo Stopping Webmin server in /usr/libexec/webmin pidfile=`grep "^pidfile=" /etc/webmin/miniserv.conf | sed -e 's/pidfile=//g'` pid=`cat \$pidfile` if [ "\$pid" != "" ]; then @@ -267,9 +265,9 @@ printf "Are you sure you want to uninstall Webmin? (y/n) : " read answer printf "\\n" if [ "\\\$answer" = "y" ]; then - echo "Removing webmin RPM .." + echo "Removing Webmin RPM package.." rpm -e --nodeps webmin - echo "Done!" + echo ".. done" fi EOFF chmod +x /etc/webmin/uninstall.sh @@ -288,11 +286,11 @@ if [ "$musthost" != "" ]; then fi if [ "\$1" == 1 ]; then if [ "\$sslmode" = "1" ]; then - echo "Webmin install complete. You can now login to https://\$host:\$port/" + echo "Webmin install complete. You can now login to https://\$host:\$port/" >>\$tempdir/webmin-setup.out 2>&1 else - echo "Webmin install complete. You can now login to http://\$host:\$port/" + echo "Webmin install complete. You can now login to http://\$host:\$port/" >>\$tempdir/webmin-setup.out 2>&1 fi - echo "as root with your root password." + echo "as root with your root password." >>\$tempdir/webmin-setup.out 2>&1 fi /bin/true @@ -302,8 +300,7 @@ if [ "\$1" = 0 ]; then if [ "\$?" = 0 ]; then # RPM is being removed, and no new version of webmin # has taken it's place. Run uninstalls and stop the server - echo "Running uninstall scripts .." - (cd /usr/libexec/webmin ; WEBMIN_CONFIG=/etc/webmin WEBMIN_VAR=/var/webmin LANG= /usr/libexec/webmin/run-uninstalls.pl) + (cd /usr/libexec/webmin ; WEBMIN_CONFIG=/etc/webmin WEBMIN_VAR=/var/webmin LANG= /usr/libexec/webmin/run-uninstalls.pl) >/dev/null 2>&1 /dev/null 2>&1 /dev/null 2>&1