summaryrefslogtreecommitdiff
path: root/update-all.in
diff options
context:
space:
mode:
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