leon / Install-script.sh
Created at Sun Mar 22 20:38:24 WIB 2020
Installation Script
Install-script.sh
Raw
#!/bin/bash
echo "========================="
echo "Welcome to Auto Bash !"
echo "========================="
# Opsi
echo ""
echo "Mau install apa gan?"
echo ""
echo "1) Nginx + PHP7.2 + PHP-FPM (For CentOS 7 Only)"
echo "2) Jitsi Meet + Nginx (For Ubuntu 18.04 Only)"
echo ""
read -p "Pilih Nomer [1/2] :" opsi
echo ""
# Input User
echo "Hanya bisa 1 User saja !"
read -p "Masukan User : " user
echo ""
# Input IP
echo "================================="
echo "Gunakan Spasi sebagai Pemisah ! "
echo "================================="
echo ""
# Looping
for hostname in $(read -p "Masukan IP : " ip && echo $ip)
do
   case $opsi in
   1) ssh -l $user $hostname "curl "https://git.leon36.web.id/gist/leon/308d73d9a17d6c90f7c4786011e52d9a/raw/master/Install-Nginx" | bash";;
   2) echo "Masih belum ada !";;
   *) echo "Kesalahan Input !"
   exit 1;;
   esac
done
echo ""
#while echo "Ulangi lagi ? (y/n) : " $read -r INPUT;
# Pertanyaan
while read -p "Ulangi Lagi ? (y/n) : " INPUT
do
   if [ "$INPUT" = "y" ]
   then
      clear
      sh install-script.sh
      #bash ssh.sh; break;
   elif [ "$INPUT " = "n" ]
   then
      echo "Selesai !~"
      break
   else
      echo "Selesai !~"
      break
   fi
done