File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11function ssh_install ()
2- {
2+ {
33 if dpkg -l | grep openssh-server &> /dev/null
44 then
55 echo " Servidor ssh ja esta instalado";
@@ -56,7 +56,7 @@ function ssh_install ()
5656
5757 echo -n " Digite a porta entre 1 e 65535 ( padrão 22 ): ";
5858 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 ]
6060 do
6161 {
6262 echo -n " Parâmetro incorreto. Digite novamente: ";
@@ -69,7 +69,7 @@ function ssh_install ()
6969
7070 echo -n " Digite o intervalo de atualização da chave ( em segundos ): ";
7171 read time;
72- while [ $time -lt 0 ]
72+ while echo $time | egrep '[^0-9]' &> /dev/null || [ $time -lt 0 ]
7373 do
7474 {
7575 echo -n " Parâmetro incorreto. Digite novamente: ";
@@ -79,7 +79,7 @@ function ssh_install ()
7979
8080 echo -n " Digite o tamanho da chave ( 1024 é o padrão ): ";
8181 read key;
82- while [ $key -lt 0 ]
82+ while echo $key | egrep '[^0-9]' &> /dev/null || [ $key -lt 0 ]
8383 do
8484 {
8585 echo -n " Parâmetro incorreto. Digite novamente: ";
You can’t perform that action at this time.
0 commit comments