Skip to content

Commit 61de7a1

Browse files
Update branding.sh
1 parent aa4b6b4 commit 61de7a1

1 file changed

Lines changed: 31 additions & 10 deletions

File tree

lib/branding.sh

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
#!/bin/bash
22

3-
CC_VERSION="1.0.0"
4-
CC_BUILD="2025.01"
5-
CC_LICENSE="Enterprise"
3+
# Load configurations from branding.conf
4+
source "$(dirname "$0")/branding.conf"
65

6+
# Function to display the branding banner
77
show_banner() {
8-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
9-
echo " CrisisCore-Systems CompressKit Enterprise"
10-
echo " Version: ${CC_VERSION} (Build ${CC_BUILD})"
11-
echo " Licensed under CrisisCore-Systems Enterprise Agreement"
12-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
8+
local COLOR_RESET="\033[0m"
9+
local COLOR_BLUE="\033[1;34m"
10+
local COLOR_CYAN="\033[1;36m"
11+
12+
echo -e "${COLOR_BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${COLOR_RESET}"
13+
echo -e "${COLOR_CYAN} CrisisCore-Systems CompressKit Enterprise${COLOR_RESET}"
14+
echo -e "${COLOR_CYAN} Version: ${CC_VERSION} (Build ${CC_BUILD})${COLOR_RESET}"
15+
echo -e "${COLOR_CYAN} Licensed under CrisisCore-Systems Enterprise Agreement${COLOR_RESET}"
16+
echo -e "${COLOR_BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${COLOR_RESET}"
17+
echo -e " \"Optimizing the weight of worlds, one PDF at a time.\""
1318
}
1419

20+
# Function to validate the license using an external script
1521
check_license() {
1622
local license_key="$1"
17-
# Add license validation logic here
18-
return 0
23+
"$(dirname "$0")/validate_license.sh" "$license_key" || {
24+
echo "Invalid license key. Exiting."
25+
exit 1
26+
}
27+
}
28+
29+
# Log errors for auditing
30+
log_error() {
31+
echo "$(date '+%Y-%m-%d %H:%M:%S') [ERROR] $1" >> "$(dirname "$0")/compresskit.log"
1932
}
33+
34+
# Trap unexpected errors and log them
35+
trap 'log_error "An unexpected error occurred."' ERR
36+
37+
# Example usage
38+
show_banner
39+
# Uncomment the next line to check a license key
40+
# check_license "YOUR_LICENSE_KEY"

0 commit comments

Comments
 (0)