fix: mv config.yml to config-default.yml in the latest version of apisix (#72)
* fix: mv config.yml to config-default.yml in the latest version of apisix
* fix: wget output config.yaml
* fix: wget -O
* fix: bad indentation
diff --git a/example/gen-config-yaml.sh b/example/gen-config-yaml.sh
index b2d9eeb..7a59529 100644
--- a/example/gen-config-yaml.sh
+++ b/example/gen-config-yaml.sh
@@ -2,10 +2,14 @@
export etcd_url='http://172.18.5.10:2379'
-wget https://raw.githubusercontent.com/apache/apisix/master/conf/config.yaml
+wget https://raw.githubusercontent.com/apache/apisix/master/conf/config-default.yaml -O config.yaml
-sed -i -e ':a' -e 'N' -e '$!ba' -e "s/allow_admin[a-z: #\/._]*\n\( *- [0-9a-zA-Z: #\/._',]*\n*\)*//g" config.yaml
-
-sed -i -e "s%http://[0-9.]*:2379%`echo $etcd_url`%g" config.yaml
+if [[ "$unamestr" == 'Darwin' ]]; then
+ sed -i '' -e ':a' -e 'N' -e '$!ba' -e "s/allow_admin[a-z: #\/._]*\n\( *- [0-9a-zA-Z: #\/._',]*\n*\)*//g" config.yaml
+ sed -i '' -e "s%http://[0-9.]*:2379%`echo $etcd_url`%g" config.yaml
+else
+ sed -i -e ':a' -e 'N' -e '$!ba' -e "s/allow_admin[a-z: #\/._]*\n\( *- [0-9a-zA-Z: #\/._',]*\n*\)*//g" config.yaml
+ sed -i -e "s%http://[0-9.]*:2379%`echo $etcd_url`%g" config.yaml
+fi
mv config.yaml ./apisix_conf/config.yaml
\ No newline at end of file