Add a specific ssh user for Windows DSI computer.
See bugzilla 1956.
This commit is contained in:
parent
2d4901769e
commit
bea48dcbd0
|
@ -56,6 +56,7 @@ hostname=$(echo ${fqdn} | cut -d'.' -f1)
|
|||
mail=$(grep "# mail:" ${config_pl_path} | cut -d':' -f 2)
|
||||
mail_ur1=$(echo ${mail} | cut -d'@' -f2)
|
||||
username=$(ldapsearch -ZZ -H ldap://ldap.univ-rennes1.fr -LLL '(mail='"${mail}"')' -b "dc=univ-rennes1,dc=fr" -x uid | grep "^uid" | cut -d" " -f2)
|
||||
backup_username=$(grep "# username:" ${config_pl_path} | cut -d':' -f 2)
|
||||
|
||||
#printf "IP: ${ip}\n"
|
||||
#printf "temp_fqdn ${temp_fqdn}\n"
|
||||
|
@ -63,6 +64,7 @@ username=$(ldapsearch -ZZ -H ldap://ldap.univ-rennes1.fr -LLL '(mail='"${mail}"'
|
|||
#printf "hostname ${hostname}\n"
|
||||
#printf "mail: ${mail}\n"
|
||||
#printf "username: ${username}\n"
|
||||
#printf "backup_username: ${backup_username}\n"
|
||||
|
||||
#### TESTS ####
|
||||
# Check IP
|
||||
|
@ -110,14 +112,20 @@ if [[ ! $(grep "${username}.${hostname}" "${backuppc_ssh_config_file}") ]]; then
|
|||
cat << EOF >> "${backuppc_ssh_config_file}"
|
||||
Host ${username}.${hostname}
|
||||
hostname ${fqdn}
|
||||
EOF
|
||||
|
||||
# Pour une machine Windows DSI, backup_user particulier
|
||||
if [[ ${backup_username} ]]; then
|
||||
cat << EOF >> "${backuppc_ssh_config_file}"
|
||||
user "${backup_username}"
|
||||
|
||||
EOF
|
||||
#cat << EOF
|
||||
#WRITE TO "${backuppc_ssh_config_file}":
|
||||
#Host ${username}.${hostname}
|
||||
#hostname ${fqdn}
|
||||
else
|
||||
cat << EOF >> "${backuppc_ssh_config_file}"
|
||||
|
||||
EOF
|
||||
fi
|
||||
|
||||
#EOF
|
||||
fi
|
||||
|
||||
#### DÉFINIR LE NOM D'HOTE POUR LE SYSTEME ####
|
||||
|
|
Loading…
Reference in New Issue