You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
v2ray-core/tools/docker/gen-server-cfg.sh

32 lines
506 B

9 years ago
#!/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)"
echo "Generated client ID: $ID"
9 years ago
cat <<EOF > server-cfg.json
{
"log" : {
"access": "/go/access.log"
9 years ago
},
"inbound": {
"port": $PORT,
9 years ago
"protocol": "vmess",
"settings": {
"clients": [
{"id": "$ID"}
]
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
}
}
EOF