Fix camcount to work with caffeine proxitude master
authorNik Black <nablack@uwaterloo.ca>
Mon, 20 Jan 2014 21:49:22 +0000 (16:49 -0500)
committerNik Black <nablack@uwaterloo.ca>
Mon, 20 Jan 2014 21:49:22 +0000 (16:49 -0500)
camcount
camcountd [new file with mode: 0755]
daemon [deleted file]

index 18f9208..a878b57 100755 (executable)
--- a/camcount
+++ b/camcount
@@ -1,12 +1,11 @@
 #!/bin/bash
 TAURINE=`nslookup taurine | grep 129.97.134 | sed -e 's/Address: //'`
-CAFFIENE=`nslookup csc | grep 129.97.134 | sed -e 's/Address: //'`
 OUTPUT=/dev/ttyUSB0
 
 stty -F $OUTPUT 4800
 while [ 1 -eq 1 ];
 do
-  FOO=`netstat -n | grep 'tcp[ \t]*[0-9]*[ \t]*[0-9]*[ \t]*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:8081' | sed 's/tcp[ \t]*[0-9]*[ \t]*[0-9]*[ \t]*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:8081[ \t]*//g' | sed 's/:.*$//g' | grep -v $TAURINE | grep -v $CAFFIENE | sort -u | wc -l`
+  FOO=`netstat -n | grep 'tcp[ \t]*[0-9]*[ \t]*[0-9]*[ \t]*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:8081' | sed 's/tcp[ \t]*[0-9]*[ \t]*[0-9]*[ \t]*[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:8081[ \t]*//g' | sed 's/:.*$//g' | grep -v $TAURINE | wc -l`
   if [ "$OLDFOO" != "$FOO" ];
   then
     OLDFOO=$FOO
diff --git a/camcountd b/camcountd
new file mode 100755 (executable)
index 0000000..8f165f0
--- /dev/null
+++ b/camcountd
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+PIDFILE=/opt/camcount/camcount.pid
+DAEMON=/opt/camcount/camcount
+
+case "$1" in
+       start)
+               start-stop-daemon -S -mp $PIDFILE -x $DAEMON -b
+               ;;
+       stop)
+               start-stop-daemon -K -p $PIDFILE -x $DAEMON
+               ;;
+       restart)
+               "$0" stop
+               "$0" start
+               ;;
+       *)
+               echo "Usage: $0 (start|stop|restart)"
+               ;;
+esac
diff --git a/daemon b/daemon
deleted file mode 100755 (executable)
index 8f165f0..0000000
--- a/daemon
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-PIDFILE=/opt/camcount/camcount.pid
-DAEMON=/opt/camcount/camcount
-
-case "$1" in
-       start)
-               start-stop-daemon -S -mp $PIDFILE -x $DAEMON -b
-               ;;
-       stop)
-               start-stop-daemon -K -p $PIDFILE -x $DAEMON
-               ;;
-       restart)
-               "$0" stop
-               "$0" start
-               ;;
-       *)
-               echo "Usage: $0 (start|stop|restart)"
-               ;;
-esac