#!/bin/bash # Date:2018/11/29 # Author: linyaohong # BLOG: ************ # Qq:122123498 # Version:1.0 # User: Centos 7 clear printf "User:$(whoami) Time:$(date +%F\ %T) ####################################################################### # SM # ####################################################################### " export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin while :; do echo 'Please select Nginx server:' echo -e "\t1. Install Nginx" echo -e "\t2. Install mysql" echo -e "\t3. Install php" echo -e "\t4. Install pure-ftp" echo -e "\t0. exit" read -e -p "Please input a number[0-9]: " option if [[ ! ${option} = [0-4] ]]; then echo "input error! Please only input number [0-9]" else if [ ${option} = 1 ]; then echo "start install Nginx" exit 1 fi if [ ${option} = 2 ]; then echo "start install mysql" exit 1 fi if [ ${option} = 3 ]; then echo "start install php" exit 1 fi if [ ${option} = 4 ]; then echo "start install pure-ftp" exit 1 fi if [ ${option} = 0 ]; then echo "opt out" exit 1 fi fi done