Updated sample if_state.sh script