summaryrefslogtreecommitdiff
path: root/update-all.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-07-11 23:22:53 +0200
committerErich Eckner <git@eckner.net>2016-07-11 23:22:53 +0200
commit56b0630251c5730ed3f03ac9d187d1ced7c1f6fe (patch)
tree68c4d492c594130dec6414ae357df20b76792eba /update-all.in
downloadupdate-all-56b0630251c5730ed3f03ac9d187d1ced7c1f6fe.tar.xz
initial Commitv0.0
Diffstat (limited to 'update-all.in')
-rw-r--r--update-all.in26
1 files changed, 26 insertions, 0 deletions
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