From 73116492498c07a2f9c45a7a66a4b03ac103d37d Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Thu, 30 Jul 2020 16:51:04 +0200
Subject: [PATCH 06/43] base-files: set default password to "openwifi"

Signed-off-by: John Crispin <john@phrozen.org>
---
 package/base-files/files/bin/config_generate  | 2 +-
 package/base-files/files/etc/shadow           | 2 +-
 package/base-files/files/usr/libexec/login.sh | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 596fcf41fa..30e7c119f7 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -303,7 +303,7 @@ generate_static_system() {
 		add system system
 		set system.@system[-1].hostname='OpenWrt'
 		set system.@system[-1].timezone='UTC'
-		set system.@system[-1].ttylogin='0'
+		set system.@system[-1].ttylogin='1'
 		set system.@system[-1].log_size='64'
 		set system.@system[-1].urandom_seed='0'
 
diff --git a/package/base-files/files/etc/shadow b/package/base-files/files/etc/shadow
index 4b4154f21f..5b3f32ce64 100644
--- a/package/base-files/files/etc/shadow
+++ b/package/base-files/files/etc/shadow
@@ -1,4 +1,4 @@
-root::0:0:99999:7:::
+root:$1$Ev771IIe$RHpqhCLW3U6c5tg9MrkQD/:18473:0:99999:7:::
 daemon:*:0:0:99999:7:::
 ftp:*:0:0:99999:7:::
 network:*:0:0:99999:7:::
diff --git a/package/base-files/files/usr/libexec/login.sh b/package/base-files/files/usr/libexec/login.sh
index 1fff39c6a0..2e8dbc0d90 100755
--- a/package/base-files/files/usr/libexec/login.sh
+++ b/package/base-files/files/usr/libexec/login.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-[ "$(uci -q get system.@system[0].ttylogin)" = 1 ] || exec /bin/ash --login
+[ "$(uci -q get system.@system[0].ttylogin)" = 0 ] && exec /bin/ash --login
 
 exec /bin/login
-- 
2.25.1

