3 # Script to update all the honours stuff on a regular basis
5 # Need to cd to the directory, otherwise nothing will work
6 directory="/home/sam/Documents/University/honours/"
9 # Need to do this too. Apparently
11 eval $(ssh-agent) 2>/dev/null
12 ssh-add /home/sam/.ssh/honours 2>/dev/null
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\""
23 $git add thesis/proposal/*.tex
24 $git add thesis/proposal/*.pdf
25 $git add thesis/proposal/*.bib
29 $git add course/semester2
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
39 kill -9 $SSH_AGENT_PID