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.
cd ../ || exit 1
#if there was an argument given, check it for validity or print out error
if [ ! -z "$1" ]; then
#valid argument print out other valid arguments
if [ "$1" == "-h" ] || [ "$1" == "-help" ]; then
echo ""
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 "No arguments expected"
exit 1
fi
echo "Running make clean"
echo ""
make clean
check_result $? "make clean"
echo "Saving the configure state"
echo ""
cp config.status tmp.status || exit 1
cp wolfssl/options.h tmp.options.h || exit 1
run_renewcerts
cd ../ || exit 1
rm ./certs/wolfssl.cnf
echo "Running make clean"
echo ""
make clean
check_result $? "make clean"
# restore previous configure state
restore_config
check_result $? "restoring old configuration"
run_renewcerts
cd ../ || exit 1
rm ./certs/wolfssl.cnf
fi #END already defined
# restore previous configure state
restore_config
check_result $? "restoring old configuration"
exit 0