aboutsummaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-09-20 21:19:05 +0200
committerKarel Kočí <cynerd@email.cz>2017-09-20 21:22:36 +0200
commitf287ecedc78c0cc8fb485c5995b8d1cfae9f0fe8 (patch)
tree5025b33a8c3d4c69ad2b62e1169b669c56f712f9 /run.sh
parent65f52ead41dc6df73671ddd3a8c6a2edecb6dfb3 (diff)
downloadmulticonfig-f287ecedc78c0cc8fb485c5995b8d1cfae9f0fe8.tar.gz
multiconfig-f287ecedc78c0cc8fb485c5995b8d1cfae9f0fe8.tar.bz2
multiconfig-f287ecedc78c0cc8fb485c5995b8d1cfae9f0fe8.zip
Commit current statecomplicated
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh32
1 files changed, 21 insertions, 11 deletions
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