diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2023-05-25 15:12:44 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2023-05-25 15:12:44 +0200 |
commit | bd71d97a7a02ae0a423e3387e53c6294e59ae4ca (patch) | |
tree | 5294ea74e0d59eb2f620df28559eb1370975ac40 /root | |
parent | inet6.sh fix any if (diff) | |
download | n-bd71d97a7a02ae0a423e3387e53c6294e59ae4ca.tar n-bd71d97a7a02ae0a423e3387e53c6294e59ae4ca.tar.gz n-bd71d97a7a02ae0a423e3387e53c6294e59ae4ca.tar.bz2 n-bd71d97a7a02ae0a423e3387e53c6294e59ae4ca.tar.lz n-bd71d97a7a02ae0a423e3387e53c6294e59ae4ca.tar.xz n-bd71d97a7a02ae0a423e3387e53c6294e59ae4ca.tar.zst n-bd71d97a7a02ae0a423e3387e53c6294e59ae4ca.zip |
Diffstat (limited to 'root')
-rwxr-xr-x | root/posodobi.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/root/posodobi.sh b/root/posodobi.sh index 662aac2..c8d45f0 100755 --- a/root/posodobi.sh +++ b/root/posodobi.sh @@ -1,10 +1,28 @@ #!/bin/bash +if grep "cron" <<<"$@" > /dev/null +then + i=`sed s,^./,,g <<<$0` + t=`mktemp -p "" $i.XXX.html` + status=$? + if [ ! $status -eq 0 ] + then + echo začasne datoteke ni uspelo izdelati. mktemp je končal s $status. + exit 1 + fi + $0 --no-ask --colour 2>&1 | aha --black --title "`hostname` $0 cron `date`" > $t + status=$? + if [ ! $status -eq 0 ] + then + echo posodobitev ni uspela. $0 je končal s $status. izhod je dostopen na http://`hostname`.sijanec.eu/$t + fi + exit $status +fi set -xe f= -a= grep "no-sync" <<<"$@" || /usr/sbin/emaint sync --auto grep "no-ask" <<<"$@" || f=--ask -[ `hostname` = varovalka ] && a=--exclude=media-libs/mesa -emerge --tree --verbose --update $f $a --newuse --changed-use --backtrack 30 --deep --with-bdeps=y --rebuilt-binaries --autounmask --autounmask-write @world -emerge @preserved-rebuild +grep "colo" <<<"$@" || f="$f --color y" +[ `hostname` = varovalka ] && f="$f --exclude=media-libs/mesa" +emerge --tree --verbose --update $f --newuse --changed-use --backtrack 30 --deep --with-bdeps=y --rebuilt-binaries --autounmask --autounmask-write @world +emerge @preserved-rebuild --autounmask-write emerge --depclean |