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
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\""
25 $git add thesis/proposal/*.tex
26 $git add thesis/proposal/*.pdf
27 $git add thesis/proposal/*.bib
31 $git add course/semester2
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
41 kill -9 $SSH_AGENT_PID