Saiko
(usa Ubuntu)
Enviado em 14/06/2018 - 11:59h
Olá, pessoal! Estou tentando instalar um gerenciador SSH na minha VPS. Encontrei um script, fiz algumas modificações mas ele continua não funcionando como deve. Sou quase que completamente leigo em shell script, então se alguém puder me ajudar, agradeço muito! Segue o script:
#!/bin/bash
rm install
cloud='https://www.dropbox.com/s/i69w7sd0xhnkunt/painelssh.zip' #MANTENHA O NOME DO ARQUIVO painelssh.zip
echo "America/Sao_Paulo" > /etc/timezone
ln -fs /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata
clear
echo 'Install By ビクヌー' #Deixar os créditos de mérito ao desenvolvedor do script.
sleep 3
apt-get update && apt-get upgrade
apt-get install lsb-release
apt-get install curl
apt-get install unzip
clear
tput bel
echo ""
echo -e "\033[1;33m ATENÇÃO. \033[0m"
echo ""
echo " Sempre que solicitado [Y/N] escolha a opção Y."
echo ""
tput setaf 3 ; tput bold ; read -n 1 -s -p "Aperte qualquer tecla para continuar..." ; echo "" ; echo "" ; tput sgr0
apt-get install apache2
apt-get install php libapache2-mod-php php-mcrypt
service apache2 restart
clear
tput bel
echo ""
echo -e "\033[1;33m ATENÇÃO. \033[0m"
echo ""
echo " Sempre que for solicitado para digite uma Senha ou Password use a mesma senha de sua preferencia e pessoal."
echo ""
echo " Utilize uma senha sem caracteres especiais ou espaço, somente LETRAS E NÚMEROS."
echo ""
echo " LEMBRE-SE desta senha ela será solicitadas varias vezes durante a Instalação."
echo ""
echo " Sempre que solicitado [Y/N] escolha a opção Y."
echo ""
tput setaf 3 ; tput bold ; read -n 1 -s -p "Aperte qualquer tecla para continuar..." ; echo "" ; echo "" ; tput sgr0
apt-get install mysql-server php-mysql
mysql_install_db
mysql_secure_installation
clear
tput bel
echo ""
echo -e "\033[1;33m ATENÇÃO. \033[0m"
echo ""
echo " Para a seleção do servidor, escolha APACHE2."
echo ""
echo " Selecione YES quando perguntado se deseja usar dbconfig-common para configurar o banco de dados."
echo ""
echo " Sua senha sera solicitada algumas vezes, lembre-se de usar sempre a mesma senha."
echo ""
tput setaf 3 ; tput bold ; read -n 1 -s -p "Aperte qualquer tecla para continuar..." ; echo "" ; echo "" ; tput sgr0
apt-get install phpmyadmin
phpenmod mcrypt
service apache2 restart
ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
apt-get install php-dev php-ssh2
php -m |grep ssh2
sleep 2
service apache2 restart
mysql -h localhost -u root -p -e "CREATE DATABASE ssh"
service apache2 restart
cd /var/www/html
wget $cloud
unzip painelssh.zip
rm painelssh.zip index.html
echo ""
tput setaf 7 ; tput bold ; read -p "Digite sua Senha: " password ; tput sgr0
echo ""
touch /var/www/html/pages/system/pass.php
echo '<?php $pass = "'$password'";?>' > /var/www/html/pages/system/pass.php
wget -qO- http://$ip/create.php
rm create.php
service apache2 restart
echo '* * * * * /usr/bin/php /var/www/html/pages/system/cron.php' >> /var/spool/cron/crontabs/root
echo '* * * * * /usr/bin/php /var/www/html/pages/system/cron.ssh.php ' >> /var/spool/cron/crontabs/root
echo '* * * * * /usr/bin/php /var/www/html/pages/system/cron.sms.php' >> /var/spool/cron/crontabs/root
echo '* * * * * /usr/bin/php /var/www/html/pages/system/cron.online.ssh.php' >> /var/spool/cron/crontabs/root
echo '10 * * * * /usr/bin/php /var/www/html/pages/system/cron.servidor.php' >> /var/spool/cron/crontabs/root
service apache2 restart
clear
tput bel
echo ""
echo -e "\033[1;33m INSTALAÇÃO CONCLUIDA COM SUCESSO. \033[0m"
echo ""
echo " Acesse seu painel digitando o IP da sua VPS no navegador de Internet, já está pronta e configurada."
echo ""
echo " É necessário dar REBOOT para reiniciar os serviços."
echo ""
tput setaf 3 ; tput bold ; read -n 1 -s -p "Aperte qualquer tecla para continuar..." ; echo "" ; echo "" ; tput sgr0
exit 1
ERROS:
: No such file or directory: #!/bin/bash
rm: cannot remove ‘install\r’: No such file or directory
./scriptpainel.sh.1: line 7: $'clear\r': command not found
sleep: invalid time interval ‘3\r’
E: Invalid operation upgrade
E: Unable to locate package lsb-release
E: Unable to locate package curl
E: Unable to locate package unzip
./scriptpainel.sh.1: line 14: $'clear\r': command not found
'put: unknown terminfo capability 'bel
'put: unknown terminfo capability 'sgr0
E: Unable to locate package apache2
Package php is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package libapache2-mod-php is not available, but is referred to by another package.
E: Package 'php' has no installation candidate
E: Package 'libapache2-mod-php' has no installation candidate
E: Unable to locate package php-mcrypt
apache2: unrecognized service
./scriptpainel.sh.1: line 25: $'clear\r': command not found
'put: unknown terminfo capability 'bel
'put: unknown terminfo capability 'sgr0
E: Unable to locate package php-mysql
./scriptpainel.sh.1: line 40: $'mysql_install_db\r': command not found
./scriptpainel.sh.1: line 41: $'mysql_secure_installation\r': command not found
./scriptpainel.sh.1: line 42: $'clear\r': command not found
'put: unknown terminfo capability 'bel
'put: unknown terminfo capability 'sgr0
E: Unable to locate package phpmyadmin
./scriptpainel.sh.1: line 55: phpenmod: command not found
apache2: unrecognized service
ln: failed to create symbolic link ‘/var/www/html/phpmyadmin\r’: No such file or directory
E: Unable to locate package php-dev
E: Unable to locate package php-ssh2
./scriptpainel.sh.1: line 59: php: command not found
sleep: invalid time interval ‘2\r’
./scriptpainel.sh.1: line 62: mysql: command not found
: No such file or directory4: cd: /var/www/html
'igite sua Senha: tput: unknown terminfo capability 'sgr0
touch: cannot touch ‘/var/www/html/pages/system/pass.php\r’: No such file or directory
: No such file or directory2: /var/www/html/pages/system/pass.php
rm: cannot remove ‘create.php\r’: No such file or directory