3 # Script to update all the honours stuff on a regular basis
7 # Need to cd to the directory, otherwise nothing will work
8 directory="/home/sam/Documents/University/honours/"
11 # Need to do this too. Apparently
13 eval $(ssh-agent) 2>/dev/null
14 ssh-add /home/sam/.ssh/honours 2>/dev/null
16 # 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 l title \"ADC4\", \"$data\" u 1:5 w l title \"ADC5\", \"$data\" u 1:2 w l title \"DAC\""
22 $git pull git.ucc # This is probably a good thing to do...
27 $git add thesis/proposal/*.tex
28 $git add thesis/proposal/*.pdf
29 $git add thesis/proposal/*.bib
33 $git add course/semester2
35 # This sets a commit message and commits. Commit will only be done if there are changed files.
36 fortune="/usr/games/fortune"
38 if [ "$message" == "" ]; then
39 message=$(echo "Automatic commit. $(date)"; echo ""; $fortune; echo "")
41 $git commit -m "$message"
42 if [ "$?" == 0 ]; then
43 echo "Commit at $(date)" >> commits.log
44 $git push git.ucc 2>&1 >> commits.log
47 kill -9 $SSH_AGENT_PID