update
This commit is contained in:
+8
-5
@@ -1,13 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Save keys to key.txt
|
||||
xray x25519 > ../conf/key.txt
|
||||
script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径
|
||||
config_dir=$script_dir/../conf
|
||||
|
||||
private_key=$(grep "Private key" ../conf/key.txt | awk -F ': ' '{print $2}')
|
||||
# Save keys to key.txt
|
||||
xray x25519 > $config_dir/key.txt
|
||||
|
||||
private_key=$(grep "Private key" $config_dir/key.txt | awk -F ': ' '{print $2}')
|
||||
|
||||
# 修改config.json密钥属性
|
||||
jq ".inbounds[0].streamSettings.realitySettings.privateKey=\"$private_key\"" ../conf/config.json > ../conf/config_temp.json
|
||||
mv ../conf/config_temp.json ../conf/config.json
|
||||
jq ".inbounds[0].streamSettings.realitySettings.privateKey=\"$private_key\"" $config_dir/config.json > $config_dir/config_temp.json
|
||||
mv $config_dir/config_temp.json $config_dir/config.json
|
||||
|
||||
echo "生成和设置密钥成功."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user