File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
package/base-files/files/etc/uci-defaults Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 33json_init
44json_load "$(cat /etc/board.json)"
55
6- json_select credentials
7- json_get_vars root_password_hash root_password_hash
8- [ -z "$root_password_hash" ] || sed -i "s|^root:[^:]*|root:$root_password_hash|g" /etc/shadow
6+ if 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
912
10- json_get_vars root_password_plain root_password_plain
11- [ -z "$root_password_plain" ] || { (echo "$root_password_plain"; sleep 1; echo "$root_password_plain") | passwd root }
12- json_select ..
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 ..
18+ fi
You can’t perform that action at this time.
0 commit comments