2015-12-24 21:27:13 -05:00
|
|
|
#!/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)"
|
2016-02-22 04:57:43 -05:00
|
|
|
echo "Generated client ID: $ID"
|
2015-12-24 21:27:13 -05:00
|
|
|
|
|
|
|
cat <<EOF > server-cfg.json
|
|
|
|
{
|
|
|
|
"log" : {
|
2016-01-26 03:28:00 -05:00
|
|
|
"access": "/go/access.log"
|
2015-12-24 21:27:13 -05:00
|
|
|
},
|
|
|
|
"inbound": {
|
2016-08-20 14:55:45 -04:00
|
|
|
"port": $PORT,
|
2015-12-24 21:27:13 -05:00
|
|
|
"protocol": "vmess",
|
|
|
|
"settings": {
|
|
|
|
"clients": [
|
|
|
|
{"id": "$ID"}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"outbound": {
|
|
|
|
"protocol": "freedom",
|
|
|
|
"settings": {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|