diff --git a/init.sh b/init.sh index bddd305..193a604 100755 --- a/init.sh +++ b/init.sh @@ -24,10 +24,10 @@ YELLOW='\033[0;33m' BLUE='\033[0;34m' NC='\033[0m' -isSuccessful() { echo -e "${GREEN}SUCCESS:${NC} $1"; } -isError() { echo -e "${RED}ERROR:${NC} $1"; } -isNotice() { echo -e "${YELLOW}NOTICE:${NC} $1"; } -isQuestion() { echo -e -n "${BLUE}QUESTION:${NC} $1 "; } +isSuccessful() { echo -e "${GREEN}✓ Success${NC} $1"; } +isError() { echo -e "${RED}✗ Error${NC} $1"; } +isNotice() { echo -e "${YELLOW}! Notice${NC} $1"; } +isQuestion() { echo -e -n "${BLUE}❯ Question${NC} $1 "; } displayLibrePortalLogo() { local hbar; hbar=$(printf '═%.0s' $(seq 1 50)) diff --git a/scripts/config/core/config_check_missing.sh b/scripts/config/core/config_check_missing.sh index 6e68f02..fa25d0f 100755 --- a/scripts/config/core/config_check_missing.sh +++ b/scripts/config/core/config_check_missing.sh @@ -4,7 +4,7 @@ checkConfigFilesMissingFiles() { # Simply check if the configs directory exists and has some content if [ ! -d "$configs_dir" ]; then - echo -e "${RED}ERROR:${NC} Configs directory not found at $configs_dir" + isError "Configs directory not found at $configs_dir" return 1 fi @@ -41,12 +41,12 @@ checkConfigFilesMissingFiles() if [ "$found_files_count" -gt 0 ]; then if [ "$missing_files_count" -gt 0 ]; then - echo -e "${GREEN}SUCCESS:${NC} $missing_files_count config files were missing and have been added to the configs folder." + isSuccessful "$missing_files_count config files were missing and have been added to the configs folder." else - echo -e "${GREEN}SUCCESS:${NC} All config files are successfully set up in the configs folder." + isSuccessful "All config files are successfully set up in the configs folder." fi else - echo -e "${YELLOW}NOTICE:${NC} No configuration files found in install directory. This may be a fresh installation." + isNotice "No configuration files found in install directory. This may be a fresh installation." exit fi } diff --git a/scripts/function/checks/check_success.sh b/scripts/function/checks/check_success.sh index a444b08..12181b2 100755 --- a/scripts/function/checks/check_success.sh +++ b/scripts/function/checks/check_success.sh @@ -3,12 +3,12 @@ function checkSuccess() { if [ $? -eq 0 ]; then - echo -e "${GREEN}SUCCESS:${NC} $1" + isSuccessful "$1" if [ -f "$logs_dir/$docker_log_file" ]; then - echo "SUCCESS: $1" | sudo tee -a "$logs_dir/$docker_log_file" >/dev/null + echo "✓ Success $1" | sudo tee -a "$logs_dir/$docker_log_file" >/dev/null fi else - echo -e "${RED}ERROR:${NC} $1" + isError "$1" # Non-interactive (task processor / cron / piped): bail instead of # blocking on read. diff --git a/scripts/source/files/generate_arrays.sh b/scripts/source/files/generate_arrays.sh index 365f8e6..c2899be 100755 --- a/scripts/source/files/generate_arrays.sh +++ b/scripts/source/files/generate_arrays.sh @@ -19,8 +19,8 @@ SCRIPTS_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")" # the script keeps its zero-dependency property but still matches the look of # the rest of the install pipeline. RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[0;33m'; NC='\033[0m' -isSuccessful() { echo -e "${GREEN}SUCCESS:${NC} $1"; } -isNotice() { echo -e "${YELLOW}NOTICE:${NC} $1"; } +isSuccessful() { echo -e "${GREEN}✓ Success${NC} $1"; } +isNotice() { echo -e "${YELLOW}! Notice${NC} $1"; } isHeader() { local title="$1" local width=52 diff --git a/scripts/source/loading/initilize_files.sh b/scripts/source/loading/initilize_files.sh index 9c6fe94..001d743 100755 --- a/scripts/source/loading/initilize_files.sh +++ b/scripts/source/loading/initilize_files.sh @@ -7,8 +7,8 @@ sourceInitilize() # We will only show the header for the full app if [[ $flag == "run" ]]; then isHeader "Loading LibrePortal Startup Files" - echo -e "${YELLOW}NOTICE:${NC} If you are experiencing loading issues..." - echo -e "${YELLOW}NOTICE:${NC} Please run the following : 'libreportal reset'" + isNotice "If you are experiencing loading issues..." + isNotice "Please run the following : 'libreportal reset'" fi # Directory containing the files to source recursively @@ -40,7 +40,7 @@ sourceInitilize() # Checking for missing files for file_to_source in "${files_to_source[@]}"; do if [ ! -f "${install_scripts_dir}${file_to_source}" ]; then - echo "NOTICE: Missing file: ${install_scripts_dir}${file_to_source}" + isNotice "Missing file: ${install_scripts_dir}${file_to_source}" else source "${install_scripts_dir}${file_to_source}" #echo "Sourced file: ${install_scripts_dir}${file_to_source}" diff --git a/scripts/update/git/reset_git.sh b/scripts/update/git/reset_git.sh index c74a9fa..c49808a 100755 --- a/scripts/update/git/reset_git.sh +++ b/scripts/update/git/reset_git.sh @@ -4,7 +4,7 @@ gitReset() { # Check if this is a local installation if [[ "$CFG_INSTALL_MODE" == "local" ]]; then - echo "NOTICE: Local installation detected - Git reset is not applicable." + isNotice "Local installation detected - Git reset is not applicable." echo "To reset a local installation, please manually restore files and rerun the init script." else gitCheckGitDetails; @@ -31,11 +31,11 @@ gitReset() # Try HTTPS first if sudo -u $sudo_user_name git clone -q "$AUTH_HTTPS_REPO_URL" "$script_dir" 2>/dev/null; then - echo "SUCCESS: Git repository cloned via HTTPS into '$script_dir'." + isSuccessful "Git repository cloned via HTTPS into '$script_dir'." else # If HTTPS fails, try HTTP if sudo -u $sudo_user_name git clone -q "$AUTH_HTTP_REPO_URL" "$script_dir" 2>/dev/null; then - echo "SUCCESS: Git repository cloned via HTTP into '$script_dir'." + isSuccessful "Git repository cloned via HTTP into '$script_dir'." else isError " Failed to clone repository via both HTTPS and HTTP." exit 1 @@ -43,11 +43,11 @@ gitReset() fi elif [[ $CFG_INSTALL_MODE == "local" ]]; then if sudo -u $sudo_user_name git clone -q "https://${CLEAN_GIT_URL}.git" "$script_dir" 2>/dev/null; then - echo "SUCCESS: Git repository cloned via HTTPS into '$script_dir'." + isSuccessful "Git repository cloned via HTTPS into '$script_dir'." else # If HTTPS fails, try HTTP if sudo -u $sudo_user_name git clone -q "http://${CLEAN_GIT_URL}.git" "$script_dir" 2>/dev/null; then - echo "SUCCESS: Git repository cloned via HTTP into '$script_dir'." + isSuccessful "Git repository cloned via HTTP into '$script_dir'." fi fi fi