This script provides a safe and automated way to initialize an attendance tracking project. It ensures consistency, handles edge cases gracefully, and protects incomplete work through automatic archiving.
functions with specific responsibilities: a. place for validation
- Checks required tools (e.g., Python availability)
- Ensures the system is ready to run the project
b. fetch prog name
- Prompts the user for a valid project name
- Validates the input format
c. make directory structure
- Builds the folder hierarchy
- Prevents overwriting existing directories
d. construct application files
- Creates required project files
- Populates default configuration
e. adjust thresholds
- Allows optional customization of warning/failure values
- Validates numeric ranges
f. check structure
- Confirms all files and directories were created successfully
When the user interrupts the script (ctrl+c) the script automatically triggers and archiving process.
- The partially created project is compressed into a
.tar.gzarchive - The archive preserves the current work state
- The incomplete directory is safely removed
This prevents leaving broken or inconsistent project structures on the system.
- Rejects empty or malformed project names
- Ensures numeric values fall within allowed ranges
- Prevents accidental overwriting
- Prompts the user to choose another name
- Detects if required software is unavailable
- Stops execution with a clear error message
- Automatically archives incomplete work
- Cleans up safely using signal trapping
In terminal: cd deploy_agent_hngabo-lang ,then type: bash setup.sh (then interact with the script)