diff --git a/install.sh b/install.sh index 6693a27..e73d87e 100755 --- a/install.sh +++ b/install.sh @@ -260,28 +260,21 @@ udevadm control --reload-rules echo "i2c-dev" | tee /etc/modules-load.d/i2c-dev.conf >/dev/null -CONFIG_FILE_DIFF="" -if test -f "$CONF_FILE"; then - if test -f "$CONFIG_FILE_NAME"; then - CONFIG_FILE_DIFF=$(diff <(grep -v '^#' $CONFIG_FILE_NAME) <(grep -v '^#' $CONF_FILE)) - fi -fi - -if [[ "$CONFIG_FILE_DIFF" != "" ]] || [[ -f "$CONF_FILE" ]]; then +if [[ -f "$CONF_FILE" ]]; then read -r -p "In system remains config file from previous installation. Do you want replace this with default config file [y/N]" response case "$response" in [yY][eE][sS]|[yY]) # default will be autocreated, so that is why remove - rm -f $CONF_FILE - if [[ $? != 0 ]]; then - echo "$CONF_FILE cannot be removed correctly..." - exit 1 - fi + rm -f $CONF_FILE + if [[ $? != 0 ]]; then + echo "$CONF_FILE cannot be removed correctly..." + exit 1 + fi ;; *) ;; esac else - echo "Installed default config which can be futher modified here:" + echo "Installed default config which can be futher modified here:" echo "$CONF_FILE" fi