From f287ecedc78c0cc8fb485c5995b8d1cfae9f0fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 20 Sep 2017 21:19:05 +0200 Subject: Commit current state --- run.sh | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'run.sh') diff --git a/run.sh b/run.sh index 7a0ae4c..d0e7c71 100755 --- a/run.sh +++ b/run.sh @@ -3,16 +3,13 @@ set -e # Go to root directory cd "$(dirname $0)" -# Include utilities +# Include basic utilities . utils/echo REQ_OPS= while [ $# -gt 0 ]; do case "$1" in - -h|--help) - # TODO - ;; --verbose|-v) echo_verbose + 1 ;; @@ -24,7 +21,11 @@ while [ $# -gt 0 ]; do REQ_OPS="$REQ_OPS $1" ;; --key) - KEY_FILE="" + shift + KEY_FILE="$1" + ;; + *) + echo_die "Unknown argument: $1" ;; esac shift @@ -34,10 +35,21 @@ done [ -f hosts/"$(hostname)" ] || echo_die "No configuration for host $(hostname) found." . hosts/"$(hostname)" -# Run system sanity checks -. utils/syscheck -# Identify some variables from system +# Update git submodules +git submodule update --init --recursive || echo_die "Git submodule update failed!" + +# Include rest of the utilities +. utils/ops +. utils/encrypt . utils/identify +. utils/syscheck # This performs system check +. utils/cleaner +. utils/lock # This also creates lock +. utils/fdata +. utils/diff + +# Always add multiconfig operation +OPERATIONS="multiconfig $OPERATIONS" # Include enabled operations for OPT in $OPERATIONS; do @@ -48,13 +60,11 @@ for OPT in $OPERATIONS; do fi done -# TODO do we want to have some explicit sorting? - # Check if operations need some update if [ -z "$REQ_OPS" ]; then for OPT in $OPERATIONS; do if ! "$OPT"_check; then - echo_info "Scheduled: $OPT" + echo_info "$OPT scheduled" REQ_OPS="$REQ_OPS $OPT" fi done -- cgit v1.2.3