do not rely on pings, just return value of operations

This commit is contained in:
nachoparker 2018-02-08 14:10:30 +01:00
parent ab865519e2
commit fc0d3f96f2
5 changed files with 10 additions and 13 deletions

View File

@ -4,11 +4,12 @@
[ $(id -u) -ne 0 ] && exit 1
ping -W 2 -w 1 -q 4.2.2.2 &>/dev/null || { echo "No internet connectivity"; exit 1; }
rm -rf /tmp/ncp-check-tmp
git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || exit 1
git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp {
echo "No internet connectivity"
exit 1
}
cd /tmp/ncp-check-tmp || exit 1
VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )

View File

@ -4,10 +4,12 @@
{
[ "$(id -u)" -ne 0 ] && { printf "Must be run as root. Try 'sudo $0'\n"; exit 1; }
ping -W 2 -w 1 -q 4.2.2.2 &>/dev/null || { echo "No internet connectivity"; exit 1; }
echo -e "Downloading updates"
rm -rf /tmp/ncp-update-tmp
git clone --depth 20 -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || exit 1
git clone --depth 20 -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || {
echo "No internet connectivity"
exit 1
}
cd /tmp/ncp-update-tmp
echo -e "Performing updates"

View File

@ -57,8 +57,6 @@ EOF
# tested with git version v0.11.0-71-g018a304
configure()
{
ping -W 2 -w 1 -q 4.2.2.2 &>/dev/null || { echo "No internet connectivity"; return 1; }
local DOMAIN_LOWERCASE="${DOMAIN_,,}"
grep -q ServerName $VHOSTCFG && \

View File

@ -90,8 +90,6 @@ install()
configure()
{
ping -W 2 -w 1 -q 4.2.2.2 &>/dev/null || { echo "No internet connectivity"; return 1; }
## IF BETA SELECTED ADD "pre" to DOWNLOAD PATH
[[ "$BETA_" == yes ]] && local PREFIX="pre"
@ -160,7 +158,7 @@ configure()
fi
# wait for mariadb
pgrep -x mysqld &>/dev/null || { echo "mariaDB process not found"; return 1; }
pgrep -x mysqld &>/dev/null || echo "mariaDB process not found"
while :; do
[[ -S /var/run/mysqld/mysqld.sock ]] && break
@ -184,6 +182,7 @@ EXIT
EOF
## SET APACHE VHOST
echo "Setting up Apache..."
cat > /etc/apache2/sites-available/nextcloud.conf <<'EOF'
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
@ -206,7 +205,6 @@ EOF
</IfModule>
EOF
a2ensite nextcloud
echo "Setting up Apache..."
cat > /etc/apache2/sites-available/000-default.conf <<'EOF'
<VirtualHost _default_:80>

View File

@ -88,8 +88,6 @@ configure()
service noip2 stop
[[ $ACTIVE_ != "yes" ]] && { update-rc.d noip2 disable; return 0; }
ping -W 2 -w 1 -q 4.2.2.2 &>/dev/null || { echo "No internet connectivity"; return 1; echo "noip DDNS disabled"; }
local IF=$( ip -br l | awk '{ if ( $2 == "UP" ) print $1 }' | head -1 )
[[ "$IF" != "" ]] && IF="-I $IF"