#!/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" . #ETCDIR#/update-all.conf for systemTyp in "${!updateCmds[@]}" 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 urxvt -e ${conCmd} "hostname; ${uCmd}" & done done