Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

NSM: check for FORCE_YES #1176

Closed
dougburks opened this issue Dec 1, 2017 · 4 comments
Closed

NSM: check for FORCE_YES #1176

dougburks opened this issue Dec 1, 2017 · 4 comments

Comments

@dougburks
Copy link
Contributor

https://groups.google.com/d/topic/security-onion/kHxC7QQ5Qv0/discussion

In regard to /usr/sbin/nsm_sensor_clear, it does look like this:

# prompt to clear the sensor
prompt_user_yesno "Clear Sensor" "All collected data for sensor \"${SENSOR_NAME}\" will be cleared.\n\nDo you want to continue?" "N"
    [ "$?" -ne 0 ] && exit 1
    if [ "$PROMPT_RET" != "Y" -a "$PROMPT_RET" != "y" ]
    then
        exit 1
    fi

should be changed to:

if [ "$FORCE_YES" != "yes" ]; then
        # prompt to clear the sensor
        prompt_user_yesno "Clear Sensor" "All collected data for sensor \"${SENSOR_NAME}\" will be cleared.\n\nDo you want to continue?" "N"
        [ "$?" -ne 0 ] && exit 1
        if [ "$PROMPT_RET" != "Y" -a "$PROMPT_RET" != "y" ]
        then
                exit 1
        fi
fi

It doesn't appear to be checking if FORCE_YES is set.
@dougburks dougburks changed the title nsm_sensor_clear: check for FORCE_YES NSM: check for FORCE_YES Dec 1, 2017
@hudsonmanieri
Copy link

hudsonmanieri commented Aug 21, 2018

I had a problem with it and just found this answer now! Thanks!

By the way, I did it right after my post to security-onion group:

# prompt to clear the sensor
if [ -z $FORCE_YES ]
then
        prompt_user_yesno "Clear Sensor" "All collected data for sensor \"${SENSOR_NAME}\" will be cleared.\n\nDo you want to continue?" "N"
        ["$?" -ne 0 ] && exit 1
        if [ "$PROMPT_RET" != "Y" -a "$PROMPT_RET" != "y" ]
        then
                exit 1
        fi
fi

@dougburks
Copy link
Contributor Author

@dougburks
Copy link
Contributor Author

@dougburks
Copy link
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants