Password length for remote backups

This commit is contained in:
Bob Mottram 2015-01-18 15:36:34 +00:00
parent c840f94034
commit 344c87b2f2
1 changed files with 10 additions and 2 deletions

View File

@ -116,6 +116,9 @@ DDNS_PASSWORD=
CURRENT_DDNS_DOMAIN=
CURRENT_DDNS_CODE=
# Minimum number of characters in a password
MINIMUM_PASSWORD_LENGTH=10
# number of CPU cores
CPU_CORES=1
@ -414,11 +417,16 @@ function interactive_configuration_remote_backups {
$remote_ssh_domain != "" && \
$remote_ssh_port != "" && \
$remote_ssh_password != "" ]]; then
echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST
if [ ${#remote_ssh_password} -lt $MINIMUM_PASSWORD_LENGTH ]; then
dialog --title "Password quality check" --msgbox "The password given was too short. It must be at least $MINIMUM_PASSWORD_LENGTH characters" 6 40
else
echo "$remote_ssh_username@$remote_ssh_domain:$remote_ssh_port//home/$remote_ssh_username $remote_ssh_password" >> $FRIENDS_SERVERS_LIST
entering_remote_backups_ctr=$((entering_remote_backups_ctr + 1))
fi
else
entering_remote_backups_done="yes"
fi
entering_remote_backups_ctr=$((entering_remote_backups_ctr + 1))
done
if [ -f $FRIENDS_SERVERS_LIST ]; then
chown $MY_USERNAME:$MY_USERNAME $FRIENDS_SERVERS_LIST