Remove expectation for an argument to be passed

Added in a failing return value to flush out tests/scripts that may be calling this script multiple times with various arguments
pull/6238/head
Andras Fekete 2023-03-27 13:30:12 -04:00
parent e0e590f126
commit cadd2d9ab6
1 changed files with 17 additions and 32 deletions

View File

@ -858,42 +858,27 @@ run_renewcerts(){
#start in root. #start in root.
cd ../ || exit 1 cd ../ || exit 1
#if there was an argument given, check it for validity or print out error
if [ ! -z "$1" ]; then if [ ! -z "$1" ]; then
#valid argument print out other valid arguments echo "No arguments expected"
if [ "$1" == "-h" ] || [ "$1" == "-help" ]; then exit 1
echo "" fi
echo "\"no argument\" will attempt to update all certificates"
echo "-h or -help display this menu"
echo ""
echo ""
#else the argument was invalid, tell user to use -h or -help
else
echo ""
echo "That is not a valid option."
echo ""
echo "use -h or -help for a list of available options."
echo ""
fi
else
echo "Saving the configure state"
echo ""
cp config.status tmp.status || exit 1
cp wolfssl/options.h tmp.options.h || exit 1
echo "Running make clean" echo "Saving the configure state"
echo "" echo ""
make clean cp config.status tmp.status || exit 1
check_result $? "make clean" cp wolfssl/options.h tmp.options.h || exit 1
run_renewcerts echo "Running make clean"
cd ../ || exit 1 echo ""
rm ./certs/wolfssl.cnf make clean
check_result $? "make clean"
# restore previous configure state run_renewcerts
restore_config cd ../ || exit 1
check_result $? "restoring old configuration" rm ./certs/wolfssl.cnf
fi #END already defined # restore previous configure state
restore_config
check_result $? "restoring old configuration"
exit 0 exit 0