forked from buzzhub/lsyupdate
1
This commit is contained in:
parent
f5b17f8c89
commit
cee2535766
@ -49,8 +49,8 @@ function check_config() {
|
|||||||
current_mac_address=$(grep -o '\[.*\]' "$CONFIG_FILE" | tr -d '[]')
|
current_mac_address=$(grep -o '\[.*\]' "$CONFIG_FILE" | tr -d '[]')
|
||||||
current_port=$(grep -o 'remote_port = [0-9]*' "$CONFIG_FILE" | awk '{print $3}')
|
current_port=$(grep -o 'remote_port = [0-9]*' "$CONFIG_FILE" | awk '{print $3}')
|
||||||
|
|
||||||
echo "Current MAC Address in frpc.ini: $current_mac_address"
|
echo "Current MAC Address in frpc.ini: $current_mac_address $cloud_mac_address "
|
||||||
echo "Current Port in frpc.ini: $current_port"
|
echo "Current Port in frpc.ini: $current_port $cloud_port"
|
||||||
|
|
||||||
# 比较配置文件中的 MAC 地址和端口是否与云端匹配
|
# 比较配置文件中的 MAC 地址和端口是否与云端匹配
|
||||||
if [ "$current_mac_address" != "$cloud_mac_address" ] || [ "$current_port" != "$cloud_port" ]; then
|
if [ "$current_mac_address" != "$cloud_mac_address" ] || [ "$current_port" != "$cloud_port" ]; then
|
||||||
|
|||||||
@ -50,7 +50,7 @@ ExecStartPost=/bin/bash "$FRPC_DIR/check_config.sh"
|
|||||||
PIDFile="$FRPC_DIR/frpc.pid"
|
PIDFile="$FRPC_DIR/frpc.pid"
|
||||||
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5s
|
RestartSec=5
|
||||||
User=root
|
User=root
|
||||||
LimitNOFILE=65535
|
LimitNOFILE=65535
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ EOF
|
|||||||
echo "Port retrieved: $port"
|
echo "Port retrieved: $port"
|
||||||
# 更新配置文件中的 remote_port 字段
|
# 更新配置文件中的 remote_port 字段
|
||||||
sed -i "s/remote_port = /remote_port = $port/" "$FRPC_DIR/frpc.ini"
|
sed -i "s/remote_port = /remote_port = $port/" "$FRPC_DIR/frpc.ini"
|
||||||
sudo systemctl start lsyfrpc
|
sudo systemctl restart lsyfrpc
|
||||||
}
|
}
|
||||||
|
|
||||||
# 主函数,调用相关函数来完成安装等操作
|
# 主函数,调用相关函数来完成安装等操作
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user