enduser.sh 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/bash
  2. #Item1 Common Command
  3. sudo apt-get install python3.8 -y
  4. sudo apt-get install python3-pip -y
  5. sudo pip3 install cryptography==3.3.2
  6. sudo -H pip3 install --upgrade pip
  7. sudo apt-get install grep -y
  8. sudo apt-get install git -y
  9. sudo pip3 install gitpython
  10. sudo apt-get install python3-tk -y
  11. sudo apt-get install wget -y
  12. sudo apt-get install python3-dev -y
  13. sudo apt-get install default-libmysqlclient-dev -y
  14. sudo apt-get install build-essential -y
  15. #Item2 LAMP
  16. echo "start install LAMP"
  17. sudo apt-get install tasksel -y
  18. sudo DEBIAN_FRONTEND=noninteractive tasksel install lamp-server
  19. echo "install phpmyadmin"
  20. cd /tmp/;pwd;sudo wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0/phpMyAdmin-5.1.0-all-languages.tar.gz -q;tar -zxvf phpMyAdmin-5.1.0-all-languages.tar.gz;sudo rm phpMyAdmin-5.1.0-all-languages.tar.gz;sudo mv phpMyAdmin-5.1.0-all-languages /var/www/html/phpmyadmin
  21. cd /var/www/html/phpmyadmin;pwd;mkdir tmp;
  22. cd;pwd;
  23. echo "install phpmyadmin done"
  24. sudo apt-get install openssl -y
  25. sudo apt-get install php-common -y
  26. sudo apt-get install php-curl -y
  27. sudo apt-get install php-json -y
  28. sudo apt-get install php-mbstring -y
  29. sudo apt-get install php-mysql -y
  30. sudo apt-get install php-xml -y
  31. sudo apt-get install php-zip -y
  32. #php version
  33. sudo apt-get install php7.2-mbstring -y
  34. sudo apt-get install php7.2-xml -y
  35. sudo apt-get install php7.2-mysql -y
  36. sudo apt-get install php7.2-common -y
  37. sudo apt-get install php7.2-curl -y
  38. sudo apt-get install php7.2-json -y
  39. sudo apt-get install php7.2-zip -y
  40. echo "open apache2 "
  41. sudo service apache2 start
  42. echo "setting mysql pass"
  43. sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Gold@53743001';"
  44. #user='root'
  45. #ip='localhost'
  46. #pwd='Gold@53743001'
  47. #sudo mysql -u root -e "ALTER USER $user@$ip IDENTIFIED WITH mysql_native_password BY $pwd;"
  48. echo "setting mysql done"
  49. #Item4 Watchdog
  50. # get watchdog file proc-wdtd.conf
  51. # get watchdog file proc-wdtd
  52. # get watchdog file rc.local
  53. cd /home/使用者;pwd;sudo git clone -b procwdtdconf --single-branch http://60.250.156.230:3000/fatwolf/proc.git /home/使用者/procwdtdconf/;sudo git clone -b procwdtd --single-branch http://60.250.156.230:3000/fatwolf/proc.git /home/使用者/procwdtd/;sudo git clone -b rclocal --single-branch http://60.250.156.230:3000/fatwolf/proc.git /home/使用者/rclocal/;sudo mv /home/使用者/procwdtdconf/proc-wdtd.conf /etc/;sudo mv /home/使用者/procwdtd/proc-wdtd /usr/sbin/;sudo mv /home/使用者/rclocal/rc.local /etc/;sudo rm -rf /home/使用者/procwdtdconf/;sudo rm -rf /home/使用者/procwdtd/;sudo rm -rf /home/使用者/rclocal/
  54. sudo chmod +x /usr/sbin/proc-wdtd
  55. sudo chmod +x /etc/rc.local
  56. sudo systemctl restart rc-local.service
  57. echo "watchdog file done"
  58. #Item6 Python packegs Library
  59. cd /home/使用者;pwd;git clone -b package --single-branch http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files.git;cd Automatically_install_files/;pwd;sudo pip3 install -r requirements.txt
  60. sudo rm -rf /home/使用者/Automatically_install_files/
  61. #Item7 AP(WebPage)
  62. cd /home/使用者;pwd;sudo git clone http://60.250.156.230:3000/rita/CoffeeProject.git /home/使用者/CoffeeProject/
  63. username=使用者;sudo echo 'coffee_manage.py = "sudo python3 /home/'$username'/CoffeeProject/coffee_manage.py"'>>/etc/proc-wdtd.conf
  64. cd /home/使用者;pwd;sudo git clone http://60.250.156.230:3000/rita/BBend-Test-JWT.git /home/使用者/BBend-Test-JWT/
  65. username=使用者;sudo echo 'BBend_manage.py = "sudo python3 /home/'$username'/BBend-Test-JWT/manage.py"'>>/etc/proc-wdtd.conf
  66. cd /home/使用者;pwd;sudo git clone http://60.250.156.230:3000/Automatic_build_system/Coffee_MySQL.git /home/使用者/Coffee_MySQL/
  67. mysql -u root -pGold@53743001 < "/home/使用者/Coffee_MySQL/Coffee_MySQL.sql";
  68. sudo rm -rf /home/使用者/Coffee_MySQL/
  69. echo "AP done"
  70. sudo reboot