3563918151360c746e5a536b2333c86f9457ad03
[dotfiles.git] / shell / .local / bin / update
1 #!/bin/sh
2 DV=/etc/debian_version
3 NUL='>/dev/null 2>&1'
4
5 cmd() {
6 if [ -f $DV ]
7 then
8 echo -n 'apt-get update && apt-get dist-upgrade -y '
9 [ `head -c 1 $DV` -ge 9 ] && echo -n '--' || -n '&& apt-get '
10 echo -n 'autoremove --purge && apt-get clean && apt-get autoclean'
11 else
12 echo -n 'pacman -Syu && pacman -Qdtq | ifne xargs pacman -R'
13 fi
14 }
15
16 sudo sh -c "$(cmd)"
17 sh -c "tlmgr update --all --self && offlineimap -u ttyui && vdirsyncer sync && khal $NUL && khard $NUL && pass git pull"