|
|
|
@ -132,6 +132,22 @@ function check_dirs
@@ -132,6 +132,22 @@ function check_dirs
|
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function check_user |
|
|
|
|
{ |
|
|
|
|
if [ ! $(ssh ${dst_host} "sudo cat /etc/passwd | grep -E "^${dst_user}\:" | wc -l") -eq 1 ]; then |
|
|
|
|
ERROR="L'utilisateur ${dst_user} n'existe pas sur ${dst_host}" |
|
|
|
|
fct_erreur 2 |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function check_group |
|
|
|
|
{ |
|
|
|
|
if [ ! $(ssh ${dst_host} "sudo cat /etc/group | grep -E "^${dst_group}\:" | wc -l") -eq 1 ]; then |
|
|
|
|
ERROR="Le groupe ${dst_group} n'existe pas sur ${dst_host}" |
|
|
|
|
fct_erreur 2 |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function create_dst_dir |
|
|
|
|
{ |
|
|
|
|
fct_message "Création du répertoire de destination ${dst_host}:${dst_dir}" -color jaune |
|
|
|
@ -263,6 +279,8 @@ ARCHIVE_NAME=${RND}.tgz
@@ -263,6 +279,8 @@ ARCHIVE_NAME=${RND}.tgz
|
|
|
|
|
|
|
|
|
|
check_hosts |
|
|
|
|
check_dirs |
|
|
|
|
check_user |
|
|
|
|
check_group |
|
|
|
|
if [ "${create}" == "true" ]; then |
|
|
|
|
create_dst_dir |
|
|
|
|
fi |
|
|
|
|