diff --git a/scripts/auto-cpufreq-dinit b/scripts/auto-cpufreq-dinit new file mode 100644 index 0000000..dafbcba --- /dev/null +++ b/scripts/auto-cpufreq-dinit @@ -0,0 +1,3 @@ +type = scripted +command = /usr/local/bin/auto-cpufreq --daemon +run-as = root \ No newline at end of file diff --git a/scripts/auto-cpufreq-install.sh b/scripts/auto-cpufreq-install.sh index a192320..33e90de 100755 --- a/scripts/auto-cpufreq-install.sh +++ b/scripts/auto-cpufreq-install.sh @@ -89,6 +89,16 @@ elif [ "$(ps h -o comm 1)" = "s6-svscan" ];then s6-rc -u change auto-cpufreq default echo -e "\n* Update daemon service bundle (s6)" s6-db-reload +# Install script for dinit +elif [ "$(ps h -o comm 1)" = "dinit" ];then + echo -e "\n* Deploying auto-cpufreq dinit unit file" + cp /usr/local/share/auto-cpufreq/scripts/auto-cpufreq-dinit /etc/dinit.d/auto-cpufreq + + echo -e "Starting auto-cpufreq daemon (dinit) service" + dinitctl start auto-cpufreq + + echo -e "\n* Enabling auto-cpufreq daemon (dinit) service at boot" + dinitctl enable auto-cpufreq 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 659e7ab..8666b09 100755 --- a/scripts/auto-cpufreq-remove.sh +++ b/scripts/auto-cpufreq-remove.sh @@ -52,6 +52,7 @@ elif [ "$(ps h -o comm 1)" = "systemd" ];then echo -e "reset failed" systemctl reset-failed +# Remove service for openrc elif [ "$(ps h -o comm 1)" = "init" ];then echo -e "\n* Stopping auto-cpufreq daemon (openrc) service" rc-service auto-cpufreq stop @@ -69,6 +70,16 @@ elif [ "$(ps h -o comm 1)" = "s6-svscan" ];then rm -rf /etc/s6/sv/auto-cpufreq echo -e "\n* Update daemon service bundle (s6)" s6-db-reload +# Remove service for dinit +elif [ "$(ps h -o comm 1)" = "init" ];then + echo -e "\n* Stopping auto-cpufreq daemon (dinit) service" + dinitctl stop auto-cpufreq + + echo -e "\n* Disabling auto-cpufreq daemon (dinit) at boot" + dinitctl disable auto-cpufreq + + echo -e "\n* Removing auto-cpufreq daemon (dinit) unit file" + rm /etc/dinit.d/auto-cpufreq 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"