Add checks loop
This commit is contained in:
parent
d62236c6fa
commit
99dbb4ab20
12
checks/internet.check
Executable file
12
checks/internet.check
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
ping -c 1 archlinux.org 2>/tmp/arch-maride-flavour_checks_error.log 1>/tmp/arch-maride-flavour_checks_out.log
|
||||
return=$?
|
||||
|
||||
if [ "$return" -eq 0 ]; then
|
||||
exit 0
|
||||
else
|
||||
echo "~> Either internet is unavailable or archlinux.org is down..."
|
||||
echo "~> (ping returned $return. Maybe check the logs in /tmp."
|
||||
exit 1
|
||||
fi
|
10
install.sh
10
install.sh
@ -16,4 +16,12 @@ if [ "$answer" != "y" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
for check in checks/*.check
|
||||
do
|
||||
echo "=> Running check '$check'..."
|
||||
. $check
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "=> Check failed. Fix it, maybe."
|
||||
exit
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user