diff --git a/mkstage4.sh b/mkstage4.sh index 8c34f9e..30547e7 100755 --- a/mkstage4.sh +++ b/mkstage4.sh @@ -13,6 +13,7 @@ EXCLUDE_CONNMAN=0 EXCLUDE_LOST=0 QUIET=0 USER_EXCL="" +USER_EXCL_FAILED="" S_KERNEL=0 x86_64=0 PARALLEL=0 @@ -65,7 +66,12 @@ while getopts ':t:e:skqcblph' flag; do EXCLUDE_LOST=1 ;; e) - USER_EXCL+=" --exclude=${OPTARG}" + if [ -e ${OPTARG} ] + then + USER_EXCL+=" --exclude=${OPTARG}" + else + USER_EXCL_FAILED+="${OPTARG} " + fi ;; p) PARALLEL=1 @@ -206,6 +212,20 @@ else TAR_OPTIONS+=" -j" fi +if [ -n "$USER_EXCL_FAILED" ] +then + echo -e "\e[33;1mWARNING:\e[0;1m Following user-specified exclude object(s) were not found: \e[0m${USER_EXCL_FAILED}" + echo "Continue anyway?" + echo -n "Type \"yes\" to continue or anything else to quit: " + read AGREE_MISMATCH + if [ "$AGREE_MISMATCH" != "yes" ] + then + exit 0 + else + echo "" + fi +fi + # if not in quiet mode, this message will be displayed: if [ "$AGREE" != "yes" ] then