Basic Skill

来源:互联网 发布:国税局知乎 编辑:程序博客网 时间:2024/06/01 09:26
Get current script path

script=$(readlink -f $0)

Check for root user

if [ "$(id -u)" -ne 0 ] ; then  echo "current user is not root "  exit 1fi

 

Read the configured Port

read -p "please set the app port for this instance [$_APP_PORT] " APP_PORTif ! echo $APP_PORT | egrep -q '^[0-9]+$' ; then  echo "setted default port: $_APP_PORT"   APP_PORT=$_APP_PORTfi

 

原创粉丝点击