diff --git a/pman.sh b/pman.sh index 284a930..4cc9f14 100755 --- a/pman.sh +++ b/pman.sh @@ -48,6 +48,11 @@ elif [ "$command_args" = "reflector" ]; then fi su_needed=true elif [ "$command_args" = "ignored" ]; then + if [ ! -f "$ignoredpkgs_file" ]; then + echo "Error: $ignoredpkgs_file does not exist, no packages ignored" >&2 + echo "use $0 ignore to start" >&2 + exit 1 + fi command="echo" command_args="$(cat $ignoredpkgs_file | sed 's/IgnorePkg = //' | sort)" elif [ "$command_args" = "ignore" ]; then @@ -63,6 +68,11 @@ elif [ "$command_args" = "ignore" ]; then done exit 0 elif [ "$command_args" = "unignore" ]; then + if [ ! -f "$ignoredpkgs_file" ]; then + echo "Error: $ignoredpkgs_file does not exist, no packages ignored" >&2 + echo "use $0 ignore to start" >&2 + exit 1 + fi for pkg in "${@}"; do command="sed" su_needed=true