Handle unexpected EOL when scripted

This commit is contained in:
ChuckPa 2023-03-28 00:23:20 -04:00
parent b15d5a55c8
commit a0184bdf24
No known key found for this signature in database
GPG Key ID: 3CE28A0F6BC31B5B

View File

@ -2,12 +2,12 @@
######################################################################### #########################################################################
# Plex Media Server database check and repair utility script. # # Plex Media Server database check and repair utility script. #
# Maintainer: ChuckPa # # Maintainer: ChuckPa #
# Version: v1.0.1 # # Version: v1.0.2 #
# Date: 16-Mar-2023 # # Date: 27-Mar-2023 #
######################################################################### #########################################################################
# Version for display purposes # Version for display purposes
Version="v1.0.1" Version="v1.0.2"
# Flag when temp files are to be retained # Flag when temp files are to be retained
Retain=0 Retain=0
@ -790,7 +790,7 @@ DoRepair() {
fi fi
# Made it to here, now verify # Made it to here, now verify
Output "Successfully imported SQL data." Output "Successfully imported databases."
WriteLog "Repair - Import - PASS" WriteLog "Repair - Import - PASS"
# Verify databases are intact and pass testing # Verify databases are intact and pass testing
@ -1405,9 +1405,16 @@ do
echo " 99 - exit" echo " 99 - exit"
fi fi
if [ $Scripted -eq 0 ]; then if [ $Scripted -eq 0 ]; then
echo "" echo ""
printf "Enter command # -or- command name (4 char min) : " printf "Enter command # -or- command name (4 char min) : "
else
Input="$1"
# If end of line then force exit
[ "$Input" = "" ] && Input="exit"
Output "Unexpected EOF / End of command line options, Exiting"
fi fi
# Watch for null command whether scripted or not. # Watch for null command whether scripted or not.