15
15
# Some adjustments might be needed for other Linux variations.
16
16
#
17
17
18
+ #
19
+ # For normal operation as TNC, digipeater, IGate, etc.
20
+ # Print audio statistics each 100 seconds for troubleshooting.
21
+ #
22
+
23
+ DWCMD=" direwolf -a 100"
24
+
25
+ #
26
+ # Set the logfile location
27
+ #
28
+
29
+ LOGFILE=/tmp/dw-start.log
30
+
18
31
#
19
32
# When running from cron, we have a very minimal environment
20
33
# including PATH=/usr/bin:/bin.
21
34
#
22
35
23
36
export PATH=/usr/local/bin:$PATH
24
37
25
- # First wait a little while in case we just rebooted
26
- # and the desktop hasn't started up yet.
27
38
#
39
+ # If we are going to use screen, we put our screen binary in
40
+ # the USESCREEN variable, otherwise, set it to 0
41
+
42
+ USESCREEN=/usr/bin/screen
28
43
29
- sleep 30
30
- LOGFILE=/tmp/dw-start.log
31
44
32
45
#
33
46
# Nothing to do if it is already running.
41
54
exit
42
55
fi
43
56
57
+ # First wait a little while in case we just rebooted
58
+ # and the desktop hasn't started up yet.
59
+ #
60
+
61
+ sleep 30
62
+
63
+ #
64
+ # If we are going the SCREEN route, then we need to
65
+ # see if we have a session open and if not, open it.
66
+ #
67
+ if [ -x $USESCREEN ]
68
+ then
69
+
70
+ # If there is no screen running, then we need one to attach to
71
+ #
72
+ if screen -list | awk ' {print $1}' | grep -q " direwolf$" ; then
73
+ echo " screen direwolf already exists" >> $LOGFILE
74
+ else
75
+ echo " creating direwolf screen session" >> $LOGFILE
76
+ screen -d -m -S direwolf
77
+ fi
78
+ sleep 1
79
+
80
+ screen -S direwolf -X screen -t Direwolf $DWCMD
81
+ exit 0
82
+
83
+ fi
84
+
85
+
44
86
#
45
87
# In my case, the Raspberry Pi is not connected to a monitor.
46
88
# I access it remotely using VNC as described here:
@@ -65,12 +107,6 @@ echo "DISPLAY=$DISPLAY" >> $LOGFILE
65
107
66
108
echo " Start up application." >> $LOGFILE
67
109
68
- #
69
- # For normal operation as TNC, digipeater, IGate, etc.
70
- # Print audio statistics each 100 seconds for troubleshooting.
71
- #
72
-
73
- DWCMD=" direwolf -a 100"
74
110
75
111
# Alternative for running with SDR receiver.
76
112
# Piping one application into another makes it a little more complicated.
0 commit comments