lots of stuff lumped together
[distro-setup] / btrbk-run
index 4642a708c1328198fb1cad6a66c5f75a8349dda2..7a1d946c88f064eafae23ae27bccd53511114aad 100755 (executable)
--- a/btrbk-run
+++ b/btrbk-run
@@ -35,7 +35,16 @@ conf_only=false
 dry_run=false # mostly for testing
 resume_arg=
 do_i=true
-do_o=true
+if [[ $HOSTNAME == $MAIL_HOST ]]; then
+    do_o=true
+else
+    do_o=false
+fi
+
+default_args_file=/etc/btrbk-run.conf
+if [[ -r $default_args_file ]]; then
+    set -- $(< $default_args_file) "$@"
+fi
 
 temp=$(getopt -l help hcinoprt: "$@") || usage 1
 eval set -- "$temp"
@@ -150,10 +159,12 @@ if [[ ! $targets ]]; then
             targets=(frodo)
             ;;
     esac
-    echo "targets: ${targets[*]}"
 fi
 
 
+echo "targets: ${targets[*]}"
+
+
 # for i, we just do a 1 way sync from master to backup,
 # and manually manage any changes to that.
 i_possible=false