Skip to content

Commit 0950827

Browse files
author
buildplan
committed
improve error handling
1 parent 61a819d commit 0950827

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

restic-backup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ display_update_info() {
9292

9393
check_and_install_restic() {
9494
echo -e "${C_BOLD}--- Checking Restic Version ---${C_RESET}"
95-
if ! command -v bzip2 &>/dev/null || ! command -v curl &>/dev/null || ! command -v gpg &>/dev/null || ! command -v jq &>/dev/null; then
95+
if ! command -v less &>/dev/null || ! command -v bzip2 &>/dev/null || ! command -v curl &>/dev/null || ! command -v gpg &>/dev/null || ! command -v jq &>/dev/null; then
9696
echo
9797
echo -e "${C_RED}ERROR: 'less', 'bzip2', 'curl', 'gpg', and 'jq' are required for secure auto-installation.${C_RESET}" >&2
9898
echo
@@ -1092,7 +1092,7 @@ run_uninstall_scheduler() {
10921092

10931093
get_verbosity_flags() {
10941094
local effective_log_level="${LOG_LEVEL:-1}"
1095-
if [[ "${VERBOSE_MODE}" == "true" ]]; then
1095+
if [[ "${VERBOSE_MODE:-}" == "true" ]]; then
10961096
effective_log_level=2 # Force verbose level 2 when --verbose is used
10971097
fi
10981098
local flags=()
@@ -1513,7 +1513,7 @@ while [[ $# -gt 0 ]]; do
15131513
shift
15141514
;;
15151515
--fix-permissions)
1516-
if ! [ -t 1 ]; then
1516+
if ! [ -t 0 ]; then
15171517
echo -e "${C_RED}ERROR: The --fix-permissions flag can only be used in an interactive session.${C_RESET}" >&2
15181518
exit 1
15191519
fi

0 commit comments

Comments
 (0)