ab8c9e3a5bae2912852dcd35ec4eb99b602a6312
[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 gnuplot="/usr/bin/gnuplot"
16 for data in $(lsof | grep interface | grep $(date +%Y) | awk '{print $NF}'); do
17         $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\""
18 done
19
20 $git add update.sh
21 $git add papers
22 $git add research
23 $git add thesis/proposal/*.tex
24 $git add thesis/proposal/*.pdf
25 $git add thesis/proposal/*.bib
26 $git add thesis/*.tex
27 $git add thesis/*.pdf
28 $git add thesis/*.bib
29 $git add course/semester2
30
31 fortune="/usr/games/fortune"
32 message=$(echo "Testing auto-plotting of stuff."; echo ""; $fortune; echo "")
33 $git commit -m "$message"
34 if [ "$?" == 0 ]; then
35         echo "Commit at $(date)" >> commits.log
36         $git push git.ucc 2>&1 >> commits.log
37 fi
38
39 kill -9 $SSH_AGENT_PID

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