diff --git a/runrole b/runrole index 201e17ea4..093497b60 100755 --- a/runrole +++ b/runrole @@ -68,6 +68,17 @@ if $REINSTALL; then # Add '_' so '--reinstall calibre' doesn't zap calibreweb echo -e "Try again without the '--reinstall' flag?\n" exit 1 fi +else + if grep -q "^${ROLE_VAR}_" $IIAB_STATE_FILE; then + echo -e "\e[1mWARNING: $IIAB_STATE_FILE already has this/these line(s):\e[0m\n" + grep "^${ROLE_VAR}_" $IIAB_STATE_FILE; echo + echo -e "To reinstall it, run: ./runrole --reinstall $1\n" + echo -n "Or continue, e.g. to enable/disable it based on var '${ROLE_VAR}_enabled' ? [Y/n] " + read ans < /dev/tty + echo + [ "$ans" = "n" ] || [ "$ans" = "N" ] && + exit 1 + fi fi grep -q "^${ROLE_VAR}_install:\s\+[Tt]rue\b" $DEFAULT_VARS_FILE && INSTALL=true