- 积分
- 6
- 威望
-
- 金钱
-
- 注册时间
- 2014-7-3
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
请教军哥,
我在想办法把lnmp1.2 做成lnmp docker 容器镜像,说的直接的一点,就是修改或添加一个新的main.sh脚本把默认项选好了自主安装就可以了。现在卡在了这段代码- Press_Install()
- {
- echo ""
- echo "Press any key to install...or Press Ctrl+c to cancel"
- OLDCONFIG=`stty -g`
- stty -icanon -echo min 1 time 0
- dd count=1 2>/dev/null
- stty ${OLDCONFIG}
- . include/version.sh
- }
复制代码
请问军哥这块怎么修改,让它不需要点击任何键直接运行啊?谢谢军哥,麻烦了!
这是修改过的main.sh, 主要是把read -p 注释掉:
- #!/bin/bash
- Dispaly_Selection()
- {
- #set mysql root password
- MysqlRootPWD="LNMP123"
- Echo_Yellow "Please setup root password of MySQL.(Default password: root)"
- #read -p "Please enter: " MysqlRootPWD
- if [ "${MysqlRootPWD}" = "" ]; then
- MysqlRootPWD="LNMP123"
- fi
- echo "MySQL root password: ${MysqlRootPWD}"
- #do you want to enable or disable the InnoDB Storage Engine?
- echo "==========================="
- InstallInnodb="y"
- Echo_Yellow "Do you want to enable or disable the InnoDB Storage Engine?"
- #read -p "Default enable,Enter your choice [Y/n]: " InstallInnodb
- case "${InstallInnodb}" in
- [yY][eE][sS]|[yY])
- echo "You will enable the InnoDB Storage Engine"
- ;;
- [nN][oO]|[nN])
- echo "You will disable the InnoDB Storage Engine!"
- ;;
- *)
- echo "No input,The InnoDB Storage Engine will enable."
- InstallInnodb="y"
- esac
- #which MySQL Version do you want to install?
- echo "==========================="
- DBSelect="2"
- Echo_Yellow "You have 5 options for your DataBase install."
- echo "1: Install MySQL 5.1.73"
- echo "2: Install MySQL 5.5.42 (Default)"
- echo "3: Install MySQL 5.6.23"
- echo "4: Install MariaDB 5.5.42"
- echo "5: Install MariaDB 10.0.17"
- #read -p "Enter your choice (1, 2, 3, 4 or 5): " DBSelect
- case "${DBSelect}" in
- 1)
- echo "You will install MySQL 5.1.73"
- ;;
- 2)
- echo "You will install MySQL 5.5.42"
- ;;
- 3)
- echo "You will Install MySQL 5.6.23"
- ;;
- 4)
- echo "You will install MariaDB 5.5.42"
- ;;
- 5)
- echo "You will install MariaDB 10.0.17"
- ;;
- *)
- echo "No input,You will install MySQL 5.5.42"
- DBSelect="2"
- esac
- if [ "${DBSelect}" = "4" ] || [ "${DBSelect}" = "5" ]; then
- MySQL_Bin="/usr/local/mariadb/bin/mysql"
- MySQL_Config="/usr/local/mariadb/bin/mysql_config"
- MySQL_Dir="/usr/local/mariadb"
- else
- MySQL_Bin="/usr/local/mysql/bin/mysql"
- MySQL_Config="/usr/local/mysql/bin/mysql_config"
- MySQL_Dir="/usr/local/mysql"
- fi
- #which PHP Version do you want to install?
- echo "==========================="
- PHPSelect="5"
- Echo_Yellow "You have 5 options for your PHP install."
- echo "1: Install PHP 5.2.17"
- echo "2: Install PHP 5.3.29"
- echo "3: Install PHP 5.4.41 (Default)"
- echo "4: Install PHP 5.5.25"
- echo "5: Install PHP 5.6.9"
- #read -p "Enter your choice (1, 2, 3, 4 or 5): " PHPSelect
- case "${PHPSelect}" in
- 1)
- echo "You will install PHP 5.2.17"
- ;;
- 2)
- echo "You will install PHP 5.3.29"
- ;;
- 3)
- echo "You will Install PHP 5.4.41"
- ;;
- 4)
- echo "You will install PHP 5.5.25"
- ;;
- 5)
- echo "You will install PHP 5.6.9"
- ;;
- *)
- echo "No input,You will install PHP 5.4.41"
- PHPSelect="3"
- esac
- #which Memory Allocator do you want to install?
- echo "==========================="
- SelectMalloc="1"
- Echo_Yellow "You have 3 options for your Memory Allocator install."
- echo "1: Don't install Memory Allocator. (Default)"
- echo "2: Install Jemalloc"
- echo "3: Install TCMalloc"
- #read -p "Enter your choice (1, 2 or 3): " SelectMalloc
复制代码 |
|