File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
function ssh_install ()
2
- {
2
+ {
3
3
if dpkg -l | grep openssh-server &> /dev/null
4
4
then
5
5
echo " Servidor ssh ja esta instalado";
@@ -56,7 +56,7 @@ function ssh_install ()
56
56
57
57
echo -n " Digite a porta entre 1 e 65535 ( padrão 22 ): ";
58
58
read port;
59
- while [ $port -lt 0 -o $port -gt 65535 ]
59
+ while echo $port | egrep '[^0-9]' &> /dev/null || [ $port -lt 0 -o $port -gt 65535 ]
60
60
do
61
61
{
62
62
echo -n " Parâmetro incorreto. Digite novamente: ";
@@ -69,7 +69,7 @@ function ssh_install ()
69
69
70
70
echo -n " Digite o intervalo de atualização da chave ( em segundos ): ";
71
71
read time;
72
- while [ $time -lt 0 ]
72
+ while echo $time | egrep '[^0-9]' &> /dev/null || [ $time -lt 0 ]
73
73
do
74
74
{
75
75
echo -n " Parâmetro incorreto. Digite novamente: ";
@@ -79,7 +79,7 @@ function ssh_install ()
79
79
80
80
echo -n " Digite o tamanho da chave ( 1024 é o padrão ): ";
81
81
read key;
82
- while [ $key -lt 0 ]
82
+ while echo $key | egrep '[^0-9]' &> /dev/null || [ $key -lt 0 ]
83
83
do
84
84
{
85
85
echo -n " Parâmetro incorreto. Digite novamente: ";
You can’t perform that action at this time.
0 commit comments