File: //lib/set-root-pw/data
#!/bin/bash
[ -n "$_INCGD_data" ] && return || readonly _INCGD_data=1
source /usr/lib/set-root-pw/json
source /usr/lib/set-root-pw/logging
data_get_uuid()
{
echo ${METADATA} | json_read uuid
}
data_get_hostname()
{
echo ${METADATA} | json_read hostname
}
data_get_authorizedkeys()
{
echo ${METADATA} | json_read "public_keys" ".\+"
}
data_get_passwordhash()
{
# Some stupid caches
if [[ "network" = "$SOURCE" ]]; then
echo ${METADATA} | json_read "x_sel_server_password_hash"
else
echo ${VENDORDATA} | json_read "meta" "x_sel_server_password_hash"
fi
}