From 56b0630251c5730ed3f03ac9d187d1ced7c1f6fe Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 11 Jul 2016 23:22:53 +0200 Subject: initial Commit --- update-all.in | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 update-all.in (limited to 'update-all.in') diff --git a/update-all.in b/update-all.in new file mode 100644 index 0000000..c672d8a --- /dev/null +++ b/update-all.in @@ -0,0 +1,26 @@ +#!/bin/bash + +declare -A updateCmd + +updateCmd["arch"]="pacman -Syu && pacdiff" +updateCmd["crux"]="ports -u && prt-get sysup && rejmerge" +updateCmd["debian"]="aptitude update && aptitude safe-upgrade && aptitude dist-upgrade" + +. #ETCDIR#/update-all.conf + +for systemTyp in "${!updateCmd[@]}" +do + eval "system=(\${${systemTyp}Systems[@]})" + for s in "${system[@]}" + do + if [ "$s" == "localhost" ] + then + conCmd="bash -c" + else + conCmd="ssh -t -t $s" + fi + echo "updating ${s} ..." + ${conCmd} "su -c \"${updateCmd["${systemTyp}"]}\"" + echo "... ${s} updated" + done +done -- cgit v1.2.3-54-g00ecf