update
This commit is contained in:
+6
-6
@@ -1,16 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
script_dir=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径
|
||||
config_dir="$script_dir/../conf"
|
||||
SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd) # 脚本文件绝对路径
|
||||
CONFIG_DIR="$SCRIPT_DIR/../conf"
|
||||
|
||||
# Save keys to key.txt
|
||||
xray x25519 > $config_dir/key.txt
|
||||
xray x25519 > $CONFIG_DIR/key.txt
|
||||
|
||||
private_key=$(grep "Private key" $config_dir/key.txt | awk -F ': ' '{print $2}')
|
||||
PRIVATE_KEY=$(grep "Private key" $CONFIG_DIR/key.txt | awk -F ': ' '{print $2}')
|
||||
|
||||
# 修改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
|
||||
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