Implement a remote interactive screen
No changes to dump1090, (except the version number)
Include a sample Linux batch start file called dump1090.sh for use when
running dump1090 headless. This file needs to be copied to the
/etc/init.d/ subdirectory on your raspberry pi, and marked as
executable. Then when you re-start your RPi, dump1090 will start-up
auto-magically and run as a sort of server to allow both local and
remote connection to it's various internet ports.
Modified the Makefile to build a new headless helper application called
view1090
Added view1090. This is an executable that allows you to connect to
dump1090 when it is running and 'see' the interactive screen display.
The default is to try and connect to dump1090 on IP address 127.0.0.1
port 30005. This should work if you are running on the same RPi as
dump1090 and using the default dump1090 port settings. However, if
you're running on a different machine you will have to specify the IP
address of the RPi running dump1090 using the --net-bo-ipaddr switch.
Something like "view1090 --net-bo-ipaddr 192.168.2.65" . You may also
have to sudo it, depending on your privilige settings.
I've also compiled view1090 as a Wiin32 exe, so you should be able to
run it under any 32 bit version of Microsoft Windows - i.e. Win95, Win
2K, Win XP, Win 7 etc. It may work on Win 8 and 64 bit Windows, but I
haven't tried it. The Win32 version is compiled from the same source, so
takes all the same command line switches.
2013-09-24 19:37:54 +02:00
|
|
|
#!/bin/bash
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
#
|
|
|
|
# Provides: dump1090
|
|
|
|
# Required-Start: $remote_fs
|
|
|
|
# Required-Stop: $remote_fs
|
|
|
|
# Default-Start: 2 3 4 5
|
|
|
|
# Default-Stop: 0 1 6
|
|
|
|
# Short-Description: dump1090 initscript
|
|
|
|
|
|
|
|
#
|
|
|
|
### END INIT INFO
|
|
|
|
## Fill in name of program here.
|
|
|
|
PROG="dump1090"
|
|
|
|
PROG_PATH="/home/pi/dump1090"
|
2014-08-06 16:26:05 +02:00
|
|
|
PROG_ARGS="--quiet --net --net-ro-size 500 --net-ro-rate 5 --net-buffer 5"
|
Implement a remote interactive screen
No changes to dump1090, (except the version number)
Include a sample Linux batch start file called dump1090.sh for use when
running dump1090 headless. This file needs to be copied to the
/etc/init.d/ subdirectory on your raspberry pi, and marked as
executable. Then when you re-start your RPi, dump1090 will start-up
auto-magically and run as a sort of server to allow both local and
remote connection to it's various internet ports.
Modified the Makefile to build a new headless helper application called
view1090
Added view1090. This is an executable that allows you to connect to
dump1090 when it is running and 'see' the interactive screen display.
The default is to try and connect to dump1090 on IP address 127.0.0.1
port 30005. This should work if you are running on the same RPi as
dump1090 and using the default dump1090 port settings. However, if
you're running on a different machine you will have to specify the IP
address of the RPi running dump1090 using the --net-bo-ipaddr switch.
Something like "view1090 --net-bo-ipaddr 192.168.2.65" . You may also
have to sudo it, depending on your privilige settings.
I've also compiled view1090 as a Wiin32 exe, so you should be able to
run it under any 32 bit version of Microsoft Windows - i.e. Win95, Win
2K, Win XP, Win 7 etc. It may work on Win 8 and 64 bit Windows, but I
haven't tried it. The Win32 version is compiled from the same source, so
takes all the same command line switches.
2013-09-24 19:37:54 +02:00
|
|
|
PIDFILE="/var/run/dump1090.pid"
|
|
|
|
|
|
|
|
start() {
|
|
|
|
if [ -e $PIDFILE ]; then
|
|
|
|
## Program is running, exit with error.
|
|
|
|
echo "Error! $PROG is currently running!" 1>&2
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
## Change from /dev/null to something like /var/log/$PROG if you want to save output.
|
|
|
|
cd $PROG_PATH
|
|
|
|
./$PROG $PROG_ARGS 2>&1 >/dev/null &
|
|
|
|
echo "$PROG started"
|
|
|
|
touch $PIDFILE
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
if [ -e $PIDFILE ]; then
|
|
|
|
## Program is running, so stop it
|
|
|
|
echo "$PROG is running"
|
|
|
|
killall $PROG
|
|
|
|
rm -f $PIDFILE
|
|
|
|
echo "$PROG stopped"
|
|
|
|
else
|
|
|
|
## Program is not running, exit with error.
|
|
|
|
echo "Error! $PROG not started!" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
## Check to see if we are running as root first.
|
|
|
|
## Found at http://www.cyberciti.biz/tips/shell-root-user-check-script.html
|
|
|
|
if [ "$(id -u)" != "0" ]; then
|
|
|
|
echo "This script must be run as root" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
reload|restart|force-reload)
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
**)
|
|
|
|
echo "Usage: $0 {start|stop|reload}" 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
#
|
|
|
|
|