aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2013-03-27 12:39:42 +0000
committerJonas Gorski <jogo@openwrt.org>2013-03-27 12:39:42 +0000
commit574bab45ac550c378af1435362e0d9782147f215 (patch)
tree6ad0e9371c19760f250c32ce960f5cb4b5dd5a7d /package/base-files
parenteedf9e72f9f81a24771bfb42472c17552bfe274d (diff)
downloadupstream-574bab45ac550c378af1435362e0d9782147f215.tar.gz
upstream-574bab45ac550c378af1435362e0d9782147f215.tar.bz2
upstream-574bab45ac550c378af1435362e0d9782147f215.zip
base-files: firstboot: only ask for confirmation on TTY
Also allow '-y' to force the reset. SVN-Revision: 36133
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/sbin/firstboot10
1 files changed, 6 insertions, 4 deletions
diff --git a/package/base-files/files/sbin/firstboot b/package/base-files/files/sbin/firstboot
index e7c0851ad0..06b64c3133 100755
--- a/package/base-files/files/sbin/firstboot
+++ b/package/base-files/files/sbin/firstboot
@@ -21,11 +21,13 @@ if [ "${0##*/}" = "firstboot" ]; then
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