Also allow '-y' to force the reset.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36133
3c298f89-4303-0410-b956-
a3cf2f4a3e73
if [ "$1" = "switch2jffs" ]; then
boot_run_hook switch2jffs
else
- local input
+ if [ -t 0 ] && [ "$1" != "-y" ]; then
+ local input
- echo -n "firstboot will erase all settings and remove any installed packages. Are you sure? [N/y]"
- read input
- [ "$input" = "y" ] || [ "$input" = "Y" ] || return 0
+ echo -n "firstboot will erase all settings and remove any installed packages. Are you sure? [N/y]"
+ read input
+ [ "$input" = "y" ] || [ "$input" = "Y" ] || return 0
+ fi
if [ -n "$jffs" ]; then
reset_has_fo=true