Skip to content

Commit 86ac952

Browse files
committed
Implement removal question for conflicting software.
1 parent d6f7d15 commit 86ac952

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

install/hst-install-debian.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,17 @@ if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
329329
echo "$conflicts"
330330
echo
331331
echo 'It is highly recommended to remove them before proceeding.'
332-
echo 'If you want to force installation run this script with -f option:'
333-
echo "Example: bash $0 --force"
334332
echo
335333
echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
336334
echo
337-
check_result 1 "Control Panel should be installed on clean server."
335+
read -p 'Would you like that we remove the packages for you? [y/n] ' answer
336+
if [ "$answer" = 'y' ] || [ "$answer" = 'Y' ]; then
337+
apt-get -qq purge $conflicts -y
338+
check_result $? 'apt-get remove failed'
339+
unset $answer
340+
else
341+
check_result 1 "Control Panel should be installed on clean server."
342+
fi
338343
fi
339344

340345
# Check network configuration

install/hst-install-ubuntu.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,17 @@ if [ ! -z "$conflicts" ] && [ -z "$force" ]; then
307307
echo "$conflicts"
308308
echo
309309
echo 'It is highly recommended to remove them before proceeding.'
310-
echo 'If you want to force installation run this script with -f option:'
311-
echo "Example: bash $0 --force"
312310
echo
313311
echo '!!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!!'
314312
echo
315-
check_result 1 "Control Panel should be installed on clean server."
313+
read -p 'Would you like that we remove the packages for you? [y/n] ' answer
314+
if [ "$answer" = 'y' ] || [ "$answer" = 'Y' ]; then
315+
apt-get -qq purge $conflicts -y
316+
check_result $? 'apt-get remove failed'
317+
unset $answer
318+
else
319+
check_result 1 "Control Panel should be installed on clean server."
320+
fi
316321
fi
317322

318323
# Check network configuration

0 commit comments

Comments
 (0)