Răsfoiți Sursa

Implement removal question for conflicting software.

Raphael Schneeberger 7 ani în urmă
părinte
comite
86ac9525fa
2 a modificat fișierele cu 16 adăugiri și 6 ștergeri
  1. 8 3
      install/hst-install-debian.sh
  2. 8 3
      install/hst-install-ubuntu.sh

+ 8 - 3
install/hst-install-debian.sh

@@ -329,12 +329,17 @@ if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
     echo "$conflicts"
     echo "$conflicts"
     echo
     echo
     echo 'It is highly recommended to remove them before proceeding.'
     echo 'It is highly recommended to remove them before proceeding.'
-    echo 'If you want to force installation run this script with -f option:'
-    echo "Example: bash $0 --force"
     echo
     echo
     echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
     echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
     echo
     echo
-    check_result 1 "Control Panel should be installed on clean server."
+    read -p 'Would you like that we remove the packages for you? [y/n] ' answer
+    if [ "$answer" = 'y' ] || [ "$answer" = 'Y'  ]; then
+        apt-get -qq purge $conflicts -y
+        check_result $? 'apt-get remove failed'
+        unset $answer
+    else
+        check_result 1 "Control Panel should be installed on clean server."
+    fi
 fi
 fi
 
 
 # Check network configuration
 # Check network configuration

+ 8 - 3
install/hst-install-ubuntu.sh

@@ -307,12 +307,17 @@ if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
     echo "$conflicts"
     echo "$conflicts"
     echo
     echo
     echo 'It is highly recommended to remove them before proceeding.'
     echo 'It is highly recommended to remove them before proceeding.'
-    echo 'If you want to force installation run this script with -f option:'
-    echo "Example: bash $0 --force"
     echo
     echo
     echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
     echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
     echo
     echo
-    check_result 1 "Control Panel should be installed on clean server."
+    read -p 'Would you like that we remove the packages for you? [y/n] ' answer
+    if [ "$answer" = 'y' ] || [ "$answer" = 'Y'  ]; then
+        apt-get -qq purge $conflicts -y
+        check_result $? 'apt-get remove failed'
+        unset $answer
+    else
+        check_result 1 "Control Panel should be installed on clean server."
+    fi
 fi
 fi
 
 
 # Check network configuration
 # Check network configuration