#!/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