This commit is contained in:
zqiushi 2025-01-08 19:36:59 +08:00
parent f5b17f8c89
commit cee2535766
2 changed files with 4 additions and 4 deletions

View File

@ -49,8 +49,8 @@ function check_config() {
current_mac_address=$(grep -o '\[.*\]' "$CONFIG_FILE" | tr -d '[]')
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 Port in frpc.ini: $current_port"
echo "Current MAC Address in frpc.ini: $current_mac_address $cloud_mac_address "
echo "Current Port in frpc.ini: $current_port $cloud_port"
# 比较配置文件中的 MAC 地址和端口是否与云端匹配
if [ "$current_mac_address" != "$cloud_mac_address" ] || [ "$current_port" != "$cloud_port" ]; then

View File

@ -50,7 +50,7 @@ ExecStartPost=/bin/bash "$FRPC_DIR/check_config.sh"
PIDFile="$FRPC_DIR/frpc.pid"
Restart=always
RestartSec=5s
RestartSec=5
User=root
LimitNOFILE=65535
@ -79,7 +79,7 @@ EOF
echo "Port retrieved: $port"
# 更新配置文件中的 remote_port 字段
sed -i "s/remote_port = /remote_port = $port/" "$FRPC_DIR/frpc.ini"
sudo systemctl start lsyfrpc
sudo systemctl restart lsyfrpc
}
# 主函数,调用相关函数来完成安装等操作