Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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