Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2018-04-03 14:08:20 +0300
committernachoparker <nacho@ownyourbits.com>2018-04-03 14:58:47 +0300
commitfa1ec759f5ae2ecd7d29eee0f963e449729a897d (patch)
tree0f6f503d84df6b33529199021ea1982619fa34bb /bin/ncp-diag
parentb94bcb42134b12f936e8067959672cba6632efe4 (diff)
ncp-web: implement dashboardv0.53.10
Diffstat (limited to 'bin/ncp-diag')
-rw-r--r--[-rwxr-xr-x]bin/ncp-diag13
1 files changed, 6 insertions, 7 deletions
diff --git a/bin/ncp-diag b/bin/ncp-diag
index e58afe72..e3f3b99b 100755..100644
--- a/bin/ncp-diag
+++ b/bin/ncp-diag
@@ -32,10 +32,12 @@ echo "datadir|$DATADIR$DIRINFO"
echo "data disk usage|$( df -h "$DATADIR" | tail -1 | awk '{ print $3"/"$2 }')"
}
echo "rootfs usage|$( df -h / | tail -1 | awk '{ print $3"/"$2 }')"
-echo "swapfile|$( swapon | tail -1 | awk '{ print $1 }' )"
+SWP="$( swapon | tail -1 | awk '{ print $1 }' )"
+[[ "$SWP" == "" ]] && SWP="none"
+echo "swapfile|$SWP"
# Nextcloud
-VERSION="$( sudo -u www-data php /var/www/nextcloud/occ status | grep "version:" | awk '{ print $3 }' )"
+VERSION="$( php /var/www/nextcloud/occ status | grep "version:" | awk '{ print $3 }' )"
if [[ "$VERSION" != "" ]]; then
echo "Nextcloud check|ok"
echo "Nextcloud version|$VERSION"
@@ -75,13 +77,10 @@ echo "gateway|$GW"
echo "interface|$IFACE"
# Certificates
-LEOUT="$( /etc/letsencrypt/letsencrypt-auto certificates 2>/dev/null )"
-CERTS="$( echo -e "$LEOUT" | grep "Domains:" | awk '{ print $2 }' | tr '\n' ' ' )"
-CDUE="$( echo -e "$LEOUT" | grep "VALID:" | grep -oP "\d+ days" | tr '\n' ' ' )"
+CERTS="$( grep "SSLCertificateFile /etc/letsencrypt/live/" /etc/apache2/sites-available/nextcloud.conf \
+ | sed 's|.*SSLCertificateFile /etc/letsencrypt/live/||;s|/fullchain.pem||' )"
[[ "$CERTS" == "" ]] && CERTS=none
-[[ "$CDUE" == "" ]] && CDUE=none
echo "certificates|$CERTS"
-echo "certs due|$CDUE"
RESOLV="$( ping -c 1 "$CERTS" 2>/dev/null | head -1 | grep -oP '\d{1,3}(.\d{1,3}){3}' )"
echo "NAT loopback|$( [[ "$RESOLV" == "$IP" ]] && echo yes || echo no )"