blob: f0bb519aece4f488c8c24310ede6d9ec338f8617 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001. /usr/share/libubox/jshn.sh
2
3json_init
4json_load "$(cat /etc/board.json)"
5
6if json_is_a credentials object; then
7 json_select credentials
8 json_get_vars root_password_hash root_password_hash
9 if [ -n "$root_password_hash" ]; then
10 sed -i "s|^root:[^:]*|root:$root_password_hash|g" /etc/shadow
11 fi
12
13 json_get_vars root_password_plain root_password_plain
14 if [ -n "$root_password_plain" ]; then
15 (echo "$root_password_plain"; sleep 1; echo "$root_password_plain") | passwd root
16 fi
17 json_select ..
18fi