mirror of
https://github.com/hak5/nano-tetra-modules.git
synced 2025-10-29 16:58:09 +00:00
Add modules to repository
This commit is contained in:
37
dump1090/scripts/dependencies.sh
Executable file
37
dump1090/scripts/dependencies.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
#2015 - Whistle Master
|
||||
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib
|
||||
export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin
|
||||
|
||||
[[ -f /tmp/dump1090.progress ]] && {
|
||||
exit 0
|
||||
}
|
||||
|
||||
touch /tmp/dump1090.progress
|
||||
|
||||
if [ "$1" = "install" ]; then
|
||||
if [ "$2" = "internal" ]; then
|
||||
opkg update
|
||||
opkg install dump1090
|
||||
elif [ "$2" = "sd" ]; then
|
||||
opkg update
|
||||
opkg install dump1090 --dest sd
|
||||
|
||||
ln -s /sd/usr/share/dump1090/ /usr/share/dump1090
|
||||
|
||||
fi
|
||||
|
||||
touch /etc/config/dump1090
|
||||
echo "config dump1090 'settings'" > /etc/config/dump1090
|
||||
echo "config dump1090 'module'" >> /etc/config/dump1090
|
||||
|
||||
uci set dump1090.module.installed=1
|
||||
uci commit dump1090.module.installed
|
||||
|
||||
elif [ "$1" = "remove" ]; then
|
||||
opkg remove dump1090
|
||||
rm -rf /etc/config/dump1090
|
||||
fi
|
||||
|
||||
rm /tmp/dump1090.progress
|
||||
43
dump1090/scripts/dump1090.sh
Executable file
43
dump1090/scripts/dump1090.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
#2015 - Whistle Master
|
||||
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib
|
||||
export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin
|
||||
|
||||
MYTIME=`date +%s`
|
||||
|
||||
OPTIONS=''
|
||||
GAIN=`uci get dump1090.settings.gain`
|
||||
FREQUENCY=`uci get dump1090.settings.frequency`
|
||||
METRICS=`uci get dump1090.settings.metrics`
|
||||
AGC=`uci get dump1090.settings.agc`
|
||||
AGGRESSIVE=`uci get dump1090.settings.aggressive`
|
||||
|
||||
CSV=`uci get dump1090.settings.csv`
|
||||
|
||||
if [ "$1" = "start" ]; then
|
||||
|
||||
if [ -n "$GAIN" ]; then
|
||||
OPTIONS="${OPTIONS} --gain ${GAIN}"
|
||||
fi
|
||||
|
||||
if [ -n "$FREQUENCY" ]; then
|
||||
OPTIONS="${OPTIONS} --freq ${FREQUENCY}"
|
||||
fi
|
||||
|
||||
if [ "$METRICS" -ne 0 ]; then OPTIONS="${OPTIONS} --metric"; fi
|
||||
if [ "$AGC" -ne 0 ]; then OPTIONS="${OPTIONS} --enable-agc"; fi
|
||||
if [ "$AGGRESSIVE" -ne 0 ]; then OPTIONS="${OPTIONS} --aggressive"; fi
|
||||
|
||||
dump1090 --net --net-http-port 9090 ${OPTIONS} 1> /pineapple/modules/dump1090/log/output_${MYTIME}.log 2> /tmp/dump1090_capture.log &
|
||||
|
||||
sleep 2
|
||||
|
||||
if [ "$CSV" -ne 0 ]; then
|
||||
nc 127.0.0.1 30003 > /pineapple/modules/dump1090/log/output_${MYTIME}.csv &
|
||||
fi
|
||||
|
||||
elif [ "$1" = "stop" ]; then
|
||||
killall -9 dump1090
|
||||
killall -9 nc
|
||||
fi
|
||||
Reference in New Issue
Block a user