forked from w2bro/docker-direwolf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
44 lines (38 loc) · 1.16 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
cd /etc/direwolf
if [ -n "$CALLSIGN" -a -n "$PASSCODE" ]; then
sed -i "s/^MYCALL.*$/MYCALL ${CALLSIGN}/g" direwolf.conf
sed -i "s/^IGLOGIN.*$/IGLOGIN ${CALLSIGN} ${PASSCODE}/g" direwolf.conf
else
echo "CALLSIGN & PASSCODE are required."
exit 2
fi
## PBEACON line configuration
if [ -n "$LATITUDE" -a -n "$LONGITUDE" ]; then
sed -i "s/%LATITUDE%/${LATITUDE}/g" direwolf.conf
sed -i "s/%LONGITUDE%/${LONGITUDE}/g" direwolf.conf
sed -i "s/%SYMBOL%/${SYMBOL}/g" direwolf.conf
sed -i "s~%COMMENT%~${COMMENT}~g" direwolf.conf
sed -i "s/$HEIGHT$/${HEIGHT}/g" direwolf.conf
else
echo "LATITUDE & LONGITUDE are required."
exit 3
fi
if [ -n "$ADEVICE" ]; then
sed -i "s/^ADEVICE.*$/ADEVICE ${ADEVICE//\//\\/}/g" direwolf.conf
fi
if [ -n "$IGSERVER" ]; then
sed -i "s/^IGSERVER.*$/IGSERVER ${IGSERVER}/g" direwolf.conf
fi
# Optionally start direwolf without rtl_fm as input
if [ -n "$DW_STANDALONE" ]; then
if [ -n "$ADEVICE" ]; then
direwolf $DWARGS -c direwolf.conf
else
echo "DW_STANDALONE requires ADEVICE also be defined."
exit 4
fi
else
rtl_fm -f $FREQUENCY -d $APRS_SDR_SERIAL | direwolf $DWARGS -c direwolf.conf
fi