aboutsummaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
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