Add force option to interactive menu
This commit is contained in:
parent
75a8370c9f
commit
5273eb4d04
2 changed files with 8 additions and 5 deletions
|
@ -70,7 +70,8 @@ This will present a menu with the following options:
|
|||
1. Process all certificates
|
||||
2. List installed certificates
|
||||
3. Check certificate expiration
|
||||
4. Exit
|
||||
4. Force update all certificates
|
||||
5. Exit
|
||||
|
||||
### Automated Mode
|
||||
Run the script with the `--silent` flag for automated operations:
|
||||
|
|
10
certman.sh
10
certman.sh
|
@ -200,15 +200,17 @@ main_menu() {
|
|||
echo "1. Process all certificates"
|
||||
echo "2. List installed certificates"
|
||||
echo "3. Check certificate expiration"
|
||||
echo "4. Exit"
|
||||
echo "4. Force update all certificates"
|
||||
echo "5. Exit"
|
||||
|
||||
read -r -p "Select an option (1-4): " choice
|
||||
read -r -p "Select an option (1-5): " choice
|
||||
|
||||
case $choice in
|
||||
1) process_certificates ;;
|
||||
1) FORCE_UPDATE="false"; process_certificates ;;
|
||||
2) ls -l "$CERT_PATH"/*.crt 2>/dev/null || echo "No certificates found" ;;
|
||||
3) check_cert_expiration ;;
|
||||
4) echo -e "${GREEN}Exiting...${NC}"; exit 0 ;;
|
||||
4) FORCE_UPDATE="true"; process_certificates; FORCE_UPDATE="false" ;;
|
||||
5) echo -e "${GREEN}Exiting...${NC}"; exit 0 ;;
|
||||
*) echo -e "${RED}Invalid option${NC}" ;;
|
||||
esac
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue