Guest User

Untitled

a guest
Aug 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)
  3.  
  4. pushd $SCRIPT_DIR >/dev/null
  5.  
  6. DB_HOST=$(aws ec2 describe-instances --output text \
  7. --filter Name=tag:Name,Values=precon \
  8. --query Reservations[].Instances[].PublicIpAddress)
  9. if [ "" = "$DB_HOST" ]; then
  10. zenity --error --text='DBサーバーのパブリックIPアドレスを取得できません'
  11. exit 1
  12. fi
  13. sed -i s/^DB_HOST=.*\$/DB_HOST=$DB_HOST/ $SCRIPT_DIR/.env
  14. php $SCRIPT_DIR/artisan serve
  15.  
  16. popd >/dev/null
Add Comment
Please, Sign In to add comment