aboutsummaryrefslogtreecommitdiff
path: root/multiconfig.sh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-09-12 00:19:18 +0200
committerKarel Kočí <cynerd@email.cz>2018-09-12 00:19:18 +0200
commita8bfe6abb693150e9ee01ea6e8d672fc074d1f1c (patch)
treec5e6cc5166c56ad45a396d9af6d4063ad755d9d5 /multiconfig.sh
parent4e4d389127254c7404bc71a308129966bd9a8b07 (diff)
downloadmulticonfig-a8bfe6abb693150e9ee01ea6e8d672fc074d1f1c.tar.gz
multiconfig-a8bfe6abb693150e9ee01ea6e8d672fc074d1f1c.tar.bz2
multiconfig-a8bfe6abb693150e9ee01ea6e8d672fc074d1f1c.zip
New multiconfig design
Diffstat (limited to 'multiconfig.sh')
-rwxr-xr-xmulticonfig.sh73
1 files changed, 0 insertions, 73 deletions
diff --git a/multiconfig.sh b/multiconfig.sh
deleted file mode 100755
index 500d0de..0000000
--- a/multiconfig.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/sh
-set -e
-MODDIR="/usr/lib/multiconfig"
-
-MODS=""
-LOCAL=false
-
-# TODO email notifications
-# TODO version verification
-
-while [ $# -gt 0 ]; do
- case "$1" in
- -h|--help)
- echo "Multiconfig system script"
- echo "Usage: multiconfig.sh [OPTION]... [MODULE]..."
- echo
- echo "Options:"
- echo "--local - use current working directory as source for files"
- exit 0
- ;;
- --local)
- LOCAL=true
- ;;
- *)
- if [ -x "$1" ]; then
- MODS="$MODS $(pwd)/$1"
- elif [ -x "$MODDIR/$1" ]; then
- MODS="$MODS $MODDIR/$1"
- else
- echo "Requested unknown mod: $1"
- exit 1
- fi
- ;;
- esac
- shift
-done
-
-[ "$(id -u)" == 0 ] || {
- echo "Please run this script only as root."
- exit 1
-}
-
-if ! $LOCAL; then
- if [ ! -d "/root/.multiconfig" ]; then
- echo "No files directory. Please setup it first."
- exit 1
- fi
- cd "/root/.multiconfig"
- # Ensure that we have correct access rights on private key
- chmod 600 ssh_key
- # Update git repository
- git fetch
- git reset --hard origin/master
- git clean -xdf
- # Verify trunk
- # TODO gpg home?
- #git verify-commit HEAD
-fi
-
-# No modules given means to process all modules
-if [ -z "$MODS" ]; then
- for M in $(find "$MODDIR" -executable); do
- MODS="$MODS $MODDIR/$M"
- done
-fi
-
-[ -n "$MODS" ] || exit 0
-
-mkdir -p /var/log/multiconfig
-for M in $MODS; do
- LOG="/var/log/multiconfig/$(basename "$M")"
- "$M" | logger -s -t "multiconfig-$M" | tee "$LOG" || echo "TODO send email!"
-done