You've already forked Geekwom-NASPi-Daemon
1
Geekwom NASPi Daemon / Geekwom NASPi Daemon (arm64, cicd.any, bookworm trixie noble, main) (push) Successful in 11s
Geekwom NASPi Daemon / Geekwom NASPi Daemon (arm64, cicd.any, bookworm trixie noble, main) (push) Successful in 11s
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
set -e
|
set -e
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
BOOT=$(/usr/bin/grep '/boot' '/etc/fstab' | /usr/bin/mawk '$1 !~ /^#/ && $2 ~ /^[/]/ {print $2}')
|
BOOT=$(/usr/bin/grep '/boot' '/etc/fstab' | /usr/bin/awk '$1 !~ /^#/ && $2 ~ /^[/]/ {print $2}')
|
||||||
/usr/bin/test -n "${BOOT}"
|
/usr/bin/test -n "${BOOT}"
|
||||||
|
|
||||||
if [ -d '/run/systemd/system' ]; then
|
if [ -d '/run/systemd/system' ]; then
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
set -e
|
set -e
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
BOOT=$(/usr/bin/grep '/boot' '/etc/fstab' | /usr/bin/mawk '$1 !~ /^#/ && $2 ~ /^[/]/ {print $2}')
|
BOOT=$(/usr/bin/grep '/boot' '/etc/fstab' | /usr/bin/awk '$1 !~ /^#/ && $2 ~ /^[/]/ {print $2}')
|
||||||
/usr/bin/test -n "${BOOT}"
|
/usr/bin/test -n "${BOOT}"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ PWM_CHIP_PATH='/sys/class/pwm/pwmchip0'
|
|||||||
###
|
###
|
||||||
|
|
||||||
function num_compare () {
|
function num_compare () {
|
||||||
/usr/bin/mawk "BEGIN {exit !($*)}"
|
/usr/bin/awk "BEGIN {exit !($*)}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function pwm_get_chip_path () {
|
function pwm_get_chip_path () {
|
||||||
@@ -61,7 +61,7 @@ function pwm_create () {
|
|||||||
|
|
||||||
function frequency_to_period () {
|
function frequency_to_period () {
|
||||||
local FREQUENCY="${1}"
|
local FREQUENCY="${1}"
|
||||||
PERC=$(/usr/bin/mawk -v freq="${FREQUENCY}" 'BEGIN { printf "%.0f", 1 / freq * 1000 * 1000000; exit(0) }')
|
PERC=$(/usr/bin/awk -v freq="${FREQUENCY}" 'BEGIN { printf "%.0f", 1 / freq * 1000 * 1000000; exit(0) }')
|
||||||
/usr/bin/echo "${PERC}"
|
/usr/bin/echo "${PERC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ function pwm_change_duty_cycle () {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
PERIOD=$(frequency_to_period "${FREQUENCY}")
|
PERIOD=$(frequency_to_period "${FREQUENCY}")
|
||||||
NEW_DUTY_CYCLE=$(/usr/bin/mawk -v period="${PERIOD}" -v dc="${DUTY_CYCLE}" 'BEGIN { printf "%.0f", period * dc / 100; exit(0) }')
|
NEW_DUTY_CYCLE=$(/usr/bin/awk -v period="${PERIOD}" -v dc="${DUTY_CYCLE}" 'BEGIN { printf "%.0f", period * dc / 100; exit(0) }')
|
||||||
/usr/bin/echo "${NEW_DUTY_CYCLE}" > "$(pwm_get_channel_path "${CHANNEL}" 'duty_cycle')"
|
/usr/bin/echo "${NEW_DUTY_CYCLE}" > "$(pwm_get_channel_path "${CHANNEL}" 'duty_cycle')"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user