summaryrefslogtreecommitdiff
path: root/update-all.in
blob: ab8dcf90ed7e4d9953e152f52c88bbe364b62231 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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
    urxvt -e ${conCmd} "hostname; su -c \"${updateCmd["${systemTyp}"]}\"" &
  done
done