1 |
# $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/functions/config_auth.sh,v 1.1 2008-06-04 16:47:56 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/functions/config_auth.sh,v 1.2 2008-06-04 19:36:18 niro Exp $ |
2 |
# configures the system authentification via mysql db settings |
# configures the system authentification via mysql db settings |
3 |
|
|
4 |
get_auth_settings() |
get_auth_settings() |
8 |
# get settings from database |
# get settings from database |
9 |
ALX_AUTH_SHELL_PW=$(mysqldo "select shell from client_auth where serial='${ALX_SERIAL}'") |
ALX_AUTH_SHELL_PW=$(mysqldo "select shell from client_auth where serial='${ALX_SERIAL}'") |
10 |
ALX_AUTH_VNC_PW=$(mysqldo "select vnc from client_auth where serial='${ALX_SERIAL}'") |
ALX_AUTH_VNC_PW=$(mysqldo "select vnc from client_auth where serial='${ALX_SERIAL}'") |
11 |
ALX_AUTH_SAMBA_PW=$(mysqldo "select samba from client_auth where serial='${ALX_SERIAL}'") |
# ALX_AUTH_SAMBA_PW=$(mysqldo "select samba from client_auth where serial='${ALX_SERIAL}'") |
12 |
ALX_AUTH_STATION_PW=$(mysqldo "select station from client_auth where serial='${ALX_SERIAL}'") |
ALX_AUTH_STATION_PW=$(mysqldo "select station from client_auth where serial='${ALX_SERIAL}'") |
13 |
|
|
14 |
export ALX_AUTH_SHELL_PW |
export ALX_AUTH_SHELL_PW |
15 |
export ALX_AUTH_VNC_PW |
export ALX_AUTH_VNC_PW |
16 |
export ALX_AUTH_SAMBA_PW |
# export ALX_AUTH_SAMBA_PW |
17 |
export ALX_AUTH_STATION_PW |
export ALX_AUTH_STATION_PW |
18 |
} |
} |
19 |
|
|
28 |
[ -n "${ALX_AUTH_STATION_PW}" ] && \ |
[ -n "${ALX_AUTH_STATION_PW}" ] && \ |
29 |
usermod -p $(openssl passwd -1 ${ALX_AUTH_SHELL_PW}) ${ALX_UNPRIV_USER} |
usermod -p $(openssl passwd -1 ${ALX_AUTH_SHELL_PW}) ${ALX_UNPRIV_USER} |
30 |
|
|
31 |
if [ -n "${ALX_AUTH_SAMBA_PW}" ] |
# if [ -n "${ALX_AUTH_SAMBA_PW}" ] |
32 |
then |
# then |
33 |
# >smb3 smbpasswd -a user password does not work anymore |
# # >smb3 smbpasswd -a user password does not work anymore |
34 |
if [[ $(smbd --version | cut -d' ' -f2) > 2.999 ]] |
# if [[ $(smbd --version | cut -d' ' -f2) > 2.999 ]] |
35 |
then |
# then |
36 |
smbpasswd -a root -s << EOF |
# smbpasswd -a root -s << EOF |
37 |
${ALX_AUTH_SAMBA_PW} |
# ${ALX_AUTH_SAMBA_PW} |
38 |
${ALX_AUTH_SAMBA_PW} |
# ${ALX_AUTH_SAMBA_PW} |
39 |
EOF |
# EOF |
40 |
else |
# else |
41 |
smbpasswd -a root ${ALX_AUTH_SAMBA_PW} |
# smbpasswd -a root ${ALX_AUTH_SAMBA_PW} |
42 |
fi |
# fi |
43 |
fi |
# fi |
44 |
|
|
45 |
# vnc passwd (min 6 chars) |
# vnc passwd (min 6 chars) |
46 |
if [ -n "${ALX_AUTH_VNC_PW}" ] |
if [ -n "${ALX_AUTH_VNC_PW}" ] |