1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-16 00:48:14 -04:00
v2fly/tools/docker/gen-server-cfg.sh
2016-01-26 16:28:00 +08:00

31 lines
472 B
Bash
Executable File

#!/bin/bash
PORT=27183
rand_str () {
cat /dev/urandom | tr -dc 'a-f0-9' | fold -w $1 | head -n 1
}
ID="$(rand_str 8)-$(rand_str 4)-$(rand_str 4)-$(rand_str 4)-$(rand_str 12)"
cat <<EOF > server-cfg.json
{
"port": $PORT,
"log" : {
"access": "/go/access.log"
},
"inbound": {
"protocol": "vmess",
"settings": {
"clients": [
{"id": "$ID"}
]
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
}
}
EOF