mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Fails faster on ssh connection
This commit is contained in:
parent
e89e146809
commit
e3e1cda79c
1 changed files with 2 additions and 2 deletions
|
@ -171,7 +171,7 @@ LXC_START () {
|
||||||
do
|
do
|
||||||
echo -n .
|
echo -n .
|
||||||
# Try to connect with ssh to check if the container is ready to work.
|
# Try to connect with ssh to check if the container is ready to work.
|
||||||
if ssh $arg_ssh $lxc_name "exit 0" > /dev/null 2>&1; then
|
if ssh $arg_ssh -o ConnectTimeout=10 $lxc_name "exit 0" > /dev/null 2>&1; then
|
||||||
# Break the for loop if the container is ready.
|
# Break the for loop if the container is ready.
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
@ -188,7 +188,7 @@ LXC_START () {
|
||||||
ECHO_FORMAT "Rebooting the container...\n" "red" "bold"
|
ECHO_FORMAT "Rebooting the container...\n" "red" "bold"
|
||||||
fi
|
fi
|
||||||
LXC_STOP # Stop the LXC container
|
LXC_STOP # Stop the LXC container
|
||||||
elif ! ssh $arg_ssh $lxc_name "sudo ping -q -c 2 security.debian.org > /dev/null 2>&1; exit \$?" >> "$test_result" 2>&1
|
elif ! ssh $arg_ssh -o ConnectTimeout=60 $lxc_name "sudo ping -q -c 2 security.debian.org > /dev/null 2>&1; exit \$?" >> "$test_result" 2>&1
|
||||||
then
|
then
|
||||||
# Try to ping security.debian.org to check the connectivity from the container
|
# Try to ping security.debian.org to check the connectivity from the container
|
||||||
ECHO_FORMAT "The container failed to connect to internet...\n" "red" "bold"
|
ECHO_FORMAT "The container failed to connect to internet...\n" "red" "bold"
|
||||||
|
|
Loading…
Add table
Reference in a new issue