distro specific fixes
[distro-setup] / btrbk-run
index 9bd6e9b6f62b3628d68648350c657c021d56d9b6..0cdc6256294d97a6fe6e4228f216975b961785dc 100644 (file)
--- a/btrbk-run
+++ b/btrbk-run
@@ -103,7 +103,7 @@ set-location() {
       at_home=true
       ;;
     x2|x3|sy|so)
-      if [[ $(dig +short @10.2.0.1 -x 10.2.0.2 2>&1 ||:) == kd.b8.nz. ]] \
+      if [[ $(timeout 1 dig +short @10.2.0.1 -x 10.2.0.2 2>&1 ||:) == kd.b8.nz. ]] \
            && ip n show 10.2.0.1 | grep . &>/dev/null; then
         # note: logic duplicated in 11-iank
         at_home=true
@@ -194,8 +194,8 @@ dry_run=false # mostly for testing
 rate_limit=no
 verbose=true; verbose_arg="-l trace"
 force=false
-if [[ $INVOCATION_ID ]]; then
-  # INVOCATION_ID means running as a systemd service. we cant show progress in this case,
+if [[ $PPID == 1 ]]; then
+  # running as a service. we cant show progress in this case,
   # but if we pass the arg, it will insert mbuffer into the command.
   progress_arg=
 else