mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-05 23:23:02 +02:00
This patch adds generation of the 20-authentication.json snippet also for failure-config. The gen-admin-auth script is extended with shell parameter, since the default shell differs from factory-config. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
26 lines
405 B
Bash
Executable File
26 lines
405 B
Bash
Executable File
#!/bin/sh
|
|
# This script extracts the admin user's password hash from VPD
|
|
|
|
shell="$1"
|
|
pwhash="$(jq .pwhash /run/system.json)"
|
|
|
|
if [ -z "$pwhash" ] || [ "$pwhash" = "null" ]; then
|
|
exit 1
|
|
fi
|
|
|
|
cat <<EOF
|
|
{
|
|
"ietf-system:system": {
|
|
"authentication": {
|
|
"user": [
|
|
{
|
|
"name": "admin",
|
|
"password": $pwhash,
|
|
"infix-system:shell": "$shell"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
EOF
|