Skip to content

Instantly share code, notes, and snippets.

@wokamoto
Last active July 1, 2016 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wokamoto/ce147a09f4fe5832bb4d5f4e1f7cc2b9 to your computer and use it in GitHub Desktop.
Save wokamoto/ce147a09f4fe5832bb4d5f4e1f7cc2b9 to your computer and use it in GitHub Desktop.
[AMIMOTO] ngx_mruby 対応 amimoto.json 作成シェルスクリプト
#!/bin/bash -ex
tmp_json=`mktemp`
amimoto_json='/opt/local/amimoto.json'
hash jq || /usr/bin/yum install -y jq
json='{"nginx":{"ngx_mruby":true}}'
echo $json > $tmp_json
[ ! -e /opt/local ] && \
/bin/mkdir -p /opt/local
[ -f $amimoto_json ] && \
/usr/bin/jq -s '.[0] * .[1]' $amimoto_json <(echo $json) > $tmp_json
[ -f $tmp_json ] && \
/bin/mv -f $tmp_json $amimoto_json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment