From: Ian Kelling <ian@iankelling.org>
Date: Mon, 21 Oct 2019 19:36:24 +0000 (-0400)
Subject: bug fixes
X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=a5d4a2af585b0eed9c613f3e1557b6c9c760d3de;p=distro-setup

bug fixes
---

diff --git a/mail-setup b/mail-setup
index 8259ff8..4414c2a 100755
--- a/mail-setup
+++ b/mail-setup
@@ -162,7 +162,7 @@ pi() { # package install
   if [[ ! -r $f ]] || (( $(( $(date +%s) - $(stat -c %Y $f ) )) > 60*60*12 )); then
     m apt-get update
   fi
-  m DEBIAN_FRONTEND=noninteractive apt-get -y install --purge --auto-remove "$@"
+  DEBIAN_FRONTEND=noninteractive m apt-get -y install --purge --auto-remove "$@"
 }
 
 postmaster=alerts
diff --git a/system-status b/system-status
index c58d9ce..ddb5b73 100755
--- a/system-status
+++ b/system-status
@@ -45,7 +45,10 @@ write-status() {
     chars+=("MAILPING!")
   fi
 
-  qlen=$(/usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}')
+  if ! qlen=$(/usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}'); then
+    # early in install process, we dont have permission yet for exiqgrep
+    qlen=$(sudo /usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}')
+  fi
   if ((qlen)); then
     chars+=("q $qlen")
   fi