mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-09-10 18:34:18 +08:00
56 lines
1.2 KiB
Bash
Executable File
56 lines
1.2 KiB
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
|
|
START=99
|
|
STOP=01
|
|
USE_PROCD=1
|
|
|
|
NAME=fancontrol
|
|
PROG=/usr/bin/fancontrol
|
|
|
|
append_option() {
|
|
local option="$1"
|
|
local argument="$2"
|
|
local value
|
|
|
|
config_get value settings "$option"
|
|
[ -n "$value" ] && procd_append_param command "$argument" "$value"
|
|
}
|
|
|
|
start_service() {
|
|
local enabled
|
|
local debug
|
|
|
|
config_load "$NAME"
|
|
config_get_bool enabled settings enabled 0
|
|
[ "$enabled" -eq 1 ] || return 0
|
|
|
|
procd_open_instance
|
|
procd_set_param command "$PROG"
|
|
append_option thermal_file -T
|
|
append_option thermal_zone -Z
|
|
append_option fan_file -F
|
|
append_option fan_hwmon -N
|
|
append_option enable_file -E
|
|
append_option start_temp -t
|
|
append_option full_speed_temp -x
|
|
append_option hysteresis -H
|
|
append_option start_speed -s
|
|
append_option max_speed -m
|
|
append_option kick_speed -k
|
|
append_option kick_ms -K
|
|
append_option fail_safe_speed -f
|
|
append_option exit_speed -q
|
|
append_option temp_div -d
|
|
append_option interval -i
|
|
config_get_bool debug settings debug 0
|
|
[ "$debug" -eq 1 ] && procd_append_param command -D
|
|
procd_set_param respawn 3600 5 5
|
|
procd_set_param term_timeout 10
|
|
procd_set_param file /etc/config/fancontrol
|
|
procd_close_instance
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger fancontrol
|
|
}
|