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 1
fi

 

Read the configured Port

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

 

 posted on 2017-06-01 11:16  ChaseForFuture  阅读(245)  评论(0编辑  收藏  举报