Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e863b21

Browse files
author
Rob Snow
committedJan 17, 2017
Added in ability to use SCREEN instead of X for those of us who use
screen.
1 parent e149e16 commit e863b21

File tree

1 file changed

+46
-10
lines changed

1 file changed

+46
-10
lines changed
 

‎dw-start.sh

+46-10
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,32 @@
1515
# Some adjustments might be needed for other Linux variations.
1616
#
1717

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+
1831
#
1932
# When running from cron, we have a very minimal environment
2033
# including PATH=/usr/bin:/bin.
2134
#
2235

2336
export PATH=/usr/local/bin:$PATH
2437

25-
# First wait a little while in case we just rebooted
26-
# and the desktop hasn't started up yet.
2738
#
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
2843

29-
sleep 30
30-
LOGFILE=/tmp/dw-start.log
3144

3245
#
3346
# Nothing to do if it is already running.
@@ -41,6 +54,35 @@ then
4154
exit
4255
fi
4356

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+
4486
#
4587
# In my case, the Raspberry Pi is not connected to a monitor.
4688
# I access it remotely using VNC as described here:
@@ -65,12 +107,6 @@ echo "DISPLAY=$DISPLAY" >> $LOGFILE
65107

66108
echo "Start up application." >> $LOGFILE
67109

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"
74110

75111
# Alternative for running with SDR receiver.
76112
# Piping one application into another makes it a little more complicated.

0 commit comments

Comments
 (0)
Please sign in to comment.