minor improvements
[distro-setup] / keyscript-on
index f26861bdfcff825425fa9e2addc3d84850286623..a2f056cc8081e281f8127649c43cce5d17f47812 100755 (executable)
@@ -19,6 +19,16 @@ sed="sed --follow-symlinks"
 # /sbin/update-initramfs: 157: mkinitramfs: not found
 PATH="/sbin:$PATH"
 
+if [[ $INVOCATION_ID ]]; then
+  if [[ -e /b/bash_unpublished/source-state ]]; then
+    source /b/bash_unpublished/source-state
+  fi
+  if [[ $MAIL_HOST && $MAIL_HOST != $HOSTNAME ]]; then
+    echo "$0: exiting early: running under systemd as MAIL_HOST"
+    exit 0
+  fi
+fi
+
 if [[ ! -e /tmp/keyscript-off ]]; then
   if [[ $($sed -rn 's/^ID=(.*)/\1/p' /etc/os-release) == arch ]]; then
     if ! grep -q '^\s*FILES=' /etc/mkinitcpio.conf; then