#!/bin/bash
-# Use this to quickly test run the server in valgrind
-#spawn-fcgi -p9005 -n ./valgrind.sh
-# Use this to run the server normally
-#./stream &
+
+# Check existence of program
+if [ ! -e "server" ]; then
+ (echo "Rebuild server.") 1>&2;
+ exit 1
+fi
+
if [[ "$(uname -m)" != *arm* ]]; then
echo Not running on the BBB
# Use this to quickly test run the server in valgrind
spawn-fcgi -p9005 -n ./valgrind.sh
# Use this to run the server normally
- #./stream &
+ #spawn-fcgi -p9005 -n ./server
exit 0
fi
exit 1
fi
-# Check existence of program
-if [ ! -e "server" ]; then
- (echo "Rebuild server.") 1>&2;
- exit 1
-fi
-
# Rotate the logs
echo Rotating the system logs
logrotate -f /etc/logrotate.d/mctxserv.conf
# TODO: Can tell spawn-fcgi to run the program as an unprivelaged user?
# But first will have to work out how to set PWM/GPIO as unprivelaged user
fails=0
-while [ $fails -lt 10 ]; do
+while [ $fails -lt 1 ]; do
spawn-fcgi -p9005 -n -- ./server $parameters
error=$?
if [ "$error" == "0" ]; then