Restart Stratux on exit
The script will now restart your stratux service if you exit the script before completing.
And some aesthetics things
@@ -54,6 +54,19 @@ function STOPSTRATUX {
sleep 3
}
+function STARTSTRATUX {
+ HEAD
+ echo "Give me a few seconds to get STRATUX running again..."
+ SDRs=`systemctl start stratux.service`
+ sleep 3
+ if [ "`systemctl is-active $SERVICE`" = "active" ]
+ then
+ echo "$SERVICE is now running"
+ else
+ echo "$SERVICE did not restart. Try 'reboot' to restart your RaspberryPI"
+ fi
+}
+
#Function to set the serial function
function SETSDRSERIAL {
HEAD
@@ -91,6 +104,7 @@ function SETSDRSERIAL {
SDRs=`reboot`
;;
exit)
+ STARTSTRATUX
echo "Exiting. "
exit 0
esac
@@ -123,6 +137,7 @@ function SDRInfo {
echo " "
;;
exit)
+ STARTSTRATUX
echo "Exiting. "
exit 0
esac
@@ -162,6 +177,7 @@ function PICKFALLBACK {
echo " "
;;
exit)
+ STARTSTRATUX
echo "Exiting. "
exit 0
esac
@@ -195,6 +211,7 @@ function PICKFREQ {
SDRInfo
;;
exit)
+ STARTSTRATUX
echo "Exiting. "
exit 0
esac
@@ -207,9 +224,10 @@ function MAINMENU {
echo "Loading SDR info..."
sleep 2
HEAD
- echo "-----------------------------------------------------------"
+ echo "# CONFIRM ONLY ONE SDR INSTALLED #"
+ echo "----------------------------------------------------------------------"
SDRs=`rtl_eeprom`
- echo "-----------------------------------------------------------"
+ echo "----------------------------------------------------------------------"
echo " "
echo "${BOLD}${RED}Read the lines above.${NORM}"
echo "${BOLD}How many SDRs were found?${NORM}"
@@ -234,10 +252,13 @@ function MAINMENU {
echo "#####################################################################################"
echo "# ${RED}Too Many SDRs Plugged in. Unplug all SDRs except one and try again!!${NORM} #"
echo "#####################################################################################"
+ STARTSTRATUX
+ echo "Exiting. "
exit 0
;;
exit)
- echo "Exiting. "
+ STARTSTRATUX
+ echo "Exiting... "
exit 0
esac
# Getting here means that a valid choice was made,
@@ -284,6 +305,7 @@ function START {
MAINMENU
;;
exit)
+ STARTSTRATUX
echo "Exiting. "
exit 0
esac
