# $Id$ # configures the system authentification via mysql db settings get_auth_settings() { local x i all count # get settings from database ALX_AUTH_SHELL_PW=$(mysqldo "select shell from client_auth where serial='${ALX_SERIAL}'") ALX_AUTH_VNC_PW=$(mysqldo "select vnc from client_auth where serial='${ALX_SERIAL}'") ALX_AUTH_STATION_PW=$(mysqldo "select station from client_auth where serial='${ALX_SERIAL}'") export ALX_AUTH_SHELL_PW export ALX_AUTH_VNC_PW export ALX_AUTH_STATION_PW } config_auth() { # first of all get the vars get_auth_settings if [[ ! -z ${ALX_AUTH_SHELL_PW} ]] then ( echo "${ALX_AUTH_SHELL_PW}"; sleep 0.1; echo "${ALX_AUTH_SHELL_PW}" ) | passwd root > /dev/null fi if [[ ! -z ${ALX_AUTH_STATION_PW} ]] then ( echo "${ALX_AUTH_STATION_PW}"; sleep 0.1; echo "${ALX_AUTH_STATION_PW}" ) | passwd ${ALX_UNPRIV_USER} > /dev/null fi # vnc passwd (min 6 chars) if [[ ! -z ${ALX_AUTH_VNC_PW} ]] then # pipe it 2x; 1st for new pw, 2nd to validate HOME=/root vncpasswd &> /dev/null << EOF ${ALX_AUTH_VNC_PW} ${ALX_AUTH_VNC_PW} EOF fi # unset vars unset ALX_AUTH_SHELL_PW unset ALX_AUTH_VNC_PW unset ALX_AUTH_STATION_PW }