来源:https://gist.github.com/ihipop/8ef5e38b4b3116ba0d4e04dbb7ca9fa5
update-komari-agent.sh 用于下载最新的 Komari Agent Linux 二进制文件并重启对应的 systemd 服务。
默认值:
- Agent 目录:
/data/komari-agent - systemd 服务:
komari-agent
| #!/bin/bash | |
| match=eth0 # Network interface name | |
| num_big_cores=2 # Number of high-performance cores to select | |
| # Retrieve cpu_capacity for each core and sort in descending order | |
| get_cpu_capacities() { | |
| for cpu in /sys/devices/system/cpu/cpu[0-9]*; do | |
| capacity_file="$cpu/cpu_capacity" | |
| if [ -f "$capacity_file" ]; then |
| [Unit] | |
| Description=Lid Monitor for Controlling KRFB Virtual Monitor | |
| After=graphical-session.target | |
| Requires=graphical-session.target | |
| [Service] | |
| ExecStart=/bin/bash %h/.local/bin/lid-monitor.sh | |
| Restart=on-failure | |
| Type=simple |
| #!/bin/bash | |
| INTERVAL=5 | |
| THRESHOLD=5 | |
| echo "开始监控 TcpOutRsts..." | |
| last_out_rsts=$(nstat -az TcpOutRsts | awk 'NR==2 {print $2}') | |
| while true; do | |
| sleep $INTERVAL | |
| current_out_rsts=$(nstat -az TcpOutRsts | awk 'NR==2 {print $2}') |
来源:https://gist.github.com/ihipop/8ef5e38b4b3116ba0d4e04dbb7ca9fa5
update-komari-agent.sh 用于下载最新的 Komari Agent Linux 二进制文件并重启对应的 systemd 服务。
默认值:
/data/komari-agentkomari-agent| #!/bin/sh | |
| # Transactional br0 network stack for LibreELEC + ConnMan + DHCP client. | |
| # | |
| # Public commands: | |
| # install - provision DHCP support and install/enable units and drop-ins | |
| # enable - create br0.enabled and start bridge mode now | |
| # disable - remove br0.enabled and return to the stock ConnMan | |
| # status - show switch, service and network state | |
| # fallback - force cleanup and return to the stock ConnMan | |
| # |