summaryrefslogtreecommitdiff
path: root/update-all.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-07-14 12:56:46 +0200
committerErich Eckner <git@eckner.net>2016-07-14 12:56:46 +0200
commit674904f5aa4178dd6c19d9e1964c9a22f7a9de76 (patch)
tree46c0f9208cf727a8fbe3f6592398fedc4bd2753d /update-all.in
parent79d809ad637f3cbecf221447f67ba03f57ddc9ff (diff)
downloadupdate-all-674904f5aa4178dd6c19d9e1964c9a22f7a9de76.tar.xz
update-me neu
Diffstat (limited to 'update-all.in')
-rw-r--r--update-all.in37
1 files changed, 10 insertions, 27 deletions
diff --git a/update-all.in b/update-all.in
index d1cf12b..76261dc 100644
--- a/update-all.in
+++ b/update-all.in
@@ -1,35 +1,18 @@
#!/bin/bash
# update-all version #VERSION#
-
-declare -A updateCmds
-declare -A hasSudo
-
-updateCmds["arch"]="pacman -Syu;pacdiff"
-updateCmds["crux"]="ports -u;prt-get sysup;rejmerge"
-updateCmds["debian"]="aptitude update;aptitude safe-upgrade;aptitude dist-upgrade"
+# updates all clients defined in #ETCDIR#/update-all.conf via local versions of update-me
. #ETCDIR#/update-all.conf
-for systemTyp in "${!updateCmds[@]}"
+for system in "${systems[@]}"
do
- eval "system=(\${${systemTyp}Systems[@]})"
- for s in "${system[@]}"
- do
- if [ "$s" == "localhost" ]
- then
- conCmd="bash -c"
- else
- conCmd="ssh -t -t $s"
- fi
- uCmd="${updateCmds["${systemTyp}"]}"
- if [ -n "${hasSudo["${s}"]}" ]
- then
- uCmd="sudo ${uCmd//;/ && sudo }"
- else
- uCmd="su -c \"${uCmd//;/ && }\""
- fi
- uCmd="${uCmd} && echo 'fertig' || echo 'fehlgeschlagen'; read s"
- urxvt -e ${conCmd} "hostname; ${uCmd}" &
- done
+ if [ "${system}" == "localhost" ]
+ then
+ cmd=""
+ else
+ cmd="ssh -t -t ${system}"
+ fi
+ cmd="${cmd} update-me"
+ urxvt -e ${cmd} &
done