sumdur: Replace -s/--seconds with the more flexible -u/--unit
[sunny256-utils.git] / livecd-exit
blob0d7e2f247402dd319a698f9c9163f68f6a1d3f07
1 #!/usr/bin/env bash
3 #=======================================================================
4 # livecd-exit
5 # File ID: 9aba4898-253c-11e4-a238-0800272e22d2
7 # Execute this before logout from a livecd session to make sure
8 # everything is committed, pushed and saved elsewhere.
10 # Author: Øyvind A. Holm <sunny@sunbase.org>
11 # License: GNU General Public License version 2 or later.
12 #=======================================================================
14 progname=livecd-exit
16 cd ~/src && git update-dirs -rqq -e "git status --porcelain" | grep . && {
17 echo $progname: Dirty repos under ~/src/ >&2
18 exit 1
20 echo $SESS_UUID | grep -q logging/ && {
21 echo $progname: Terminate logging first >&2
22 exit 1
24 test -d ~/afvroot && rsync -avzP ~/afvroot/ sunny@sunbase.org:livecd-afvroot
25 test -d ~/log/script && rsync -avzP ~/log/script/ sunny@sunbase.org:annex/log/script/livecd/
26 cd && git commit -a
27 git update-dirs -rP
28 cd ~/uuids/ && make