deploy.sh 605 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. if [ "$(id -u)" != "0" ]; then
  3. echo "This script must be run as root" 1>&2
  4. exit 1
  5. fi
  6. read -p "请输入VPN编号:" NUM
  7. cp ./sd$NUM/* /etc/openvpn/
  8. read -p "是否需要导入镜像(yes/no, default is no):" FLASH_SELECT
  9. if [ -z "${FLASH_SELECT}" ];then
  10. FLASH_SELECT="no"
  11. fi
  12. if [ "${FLASH_SELECT}" == "yes" ];then
  13. cd ~/
  14. if [ ! -f pack.tar.gz ]; then
  15. echo "No file found"
  16. exit
  17. fi
  18. tar -zxvf pack.tar.gz
  19. cd ~/pack/
  20. Folder_A="."
  21. for file_a in ${Folder_A}/*
  22. do
  23. echo "load $file_a"
  24. docker load -i $file_a
  25. done
  26. fi