diff --git a/scripts/auto-cpufreq-install.sh b/scripts/auto-cpufreq-install.sh index b85811b..119f515 100755 --- a/scripts/auto-cpufreq-install.sh +++ b/scripts/auto-cpufreq-install.sh @@ -79,6 +79,16 @@ elif [ "$(ps h -o comm 1)" = "init" ];then echo -e "\n* Enabling auto-cpufreq daemon (openrc) service at boot" rc-update add auto-cpufreq +# Install script for s6 +elif [ "$(ps h -o comm 1)" = "s6-svscan" ];then + echo -e "\n* Deploying auto-cpufreq s6 unit file" + cp -r /usr/local/share/auto-cpufreq/scripts/auto-cpufreq-s6 /etc/s6/sv/auto-cpufreq + echo -e "\n* Add auto-cpufreq service (s6) to default bundle" + s6-service add default auto-cpufreq + echo -e "Starting auto-cpufreq daemon (s6) service" + s6-rc -u change auto-cpufreq default + echo -e "\n* Update daemon service bundle (s6)" + s6-db-reload else echo -e "\n* Unsupported init system detected, could not install the daemon\n" echo -e "\n* Please open an issue on https://github.com/AdnanHodzic/auto-cpufreq\n" diff --git a/scripts/auto-cpufreq-remove.sh b/scripts/auto-cpufreq-remove.sh index 293fa48..659e7ab 100755 --- a/scripts/auto-cpufreq-remove.sh +++ b/scripts/auto-cpufreq-remove.sh @@ -61,6 +61,14 @@ elif [ "$(ps h -o comm 1)" = "init" ];then echo -e "\n* Removing auto-cpufreq daemon (openrc) unit file" rm /etc/init.d/auto-cpufreq +# Remove service for s6 +elif [ "$(ps h -o comm 1)" = "s6-svscan" ];then + echo -e "\n* Disabling auto-cpufreq daemon (s6) at boot" + s6-service delete default auto-cpufreq + echo -e "\n* Removing auto-cpufreq daemon (s6) unit file" + rm -rf /etc/s6/sv/auto-cpufreq + echo -e "\n* Update daemon service bundle (s6)" + s6-db-reload else echo -e "\n* Unsupported init system detected, could not remove the daemon\n" echo -e "\n* Please open an issue on https://github.com/AdnanHodzic/auto-cpufreq\n" diff --git a/scripts/auto-cpufreq-s6/run b/scripts/auto-cpufreq-s6/run new file mode 100644 index 0000000..2a3a9fe --- /dev/null +++ b/scripts/auto-cpufreq-s6/run @@ -0,0 +1,4 @@ +#!/bin/sh + +exec /usr/local/bin/auto-cpufreq --daemon + diff --git a/scripts/auto-cpufreq-s6/type b/scripts/auto-cpufreq-s6/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/scripts/auto-cpufreq-s6/type @@ -0,0 +1 @@ +longrun