c47cb2d98860314a174b26f7e19150816219ca84
[matches/honours.git] / update.sh
1 #!/bin/bash
2
3 # Script to update all the honours stuff on a regular basis
4
5 # Need to cd to the directory, otherwise nothing will work
6 directory="/home/sam/Documents/University/honours/"
7 cd "$directory" 
8
9 # Need to do this too. Apparently
10 git="/usr/bin/git"
11 eval $(ssh-agent) 2>/dev/null
12 ssh-add /home/sam/.ssh/honours 2>/dev/null
13
14 # This bit plots any open data files, so I can remotely view them
15 # IT WORKS!
16 # IT IS GLORIOUS!
17 gnuplot="/usr/bin/gnuplot"
18 for data in $(lsof | grep interface | grep $(date +%Y) | awk '{print $NF}'); do
19         $gnuplot -e "set term png; set output \"$data.png\"; plot \"$data\" u 1:3 w lp title \"ADC4\", \"$data\" u 1:5 w lp title \"ADC5\""
20 done
21
22 $git add update.sh
23 $git add papers
24 $git add research
25 $git add thesis/proposal/*.tex
26 $git add thesis/proposal/*.pdf
27 $git add thesis/proposal/*.bib
28 $git add thesis/*.tex
29 $git add thesis/*.pdf
30 $git add thesis/*.bib
31 $git add course/semester2
32
33 fortune="/usr/games/fortune"
34 message=$(echo "Automatic commit. $(date)"; echo ""; $fortune; echo "")
35 $git commit -m "$message"
36 if [ "$?" == 0 ]; then
37         echo "Commit at $(date)" >> commits.log
38         $git push git.ucc 2>&1 >> commits.log
39 fi
40
41 kill -9 $SSH_AGENT_PID

UCC git Repository :: git.ucc.asn.au