add s6 script for auto-cpufreq install (#421)
* add s6 script. * fixing s6 init system with reload and call s6-svscan * Fix my typo. forgot to add slash to this dir. * repalce reload init in bottom * replace the samethings like install section Co-authored-by: Anas <AnasR7@protonmail>
This commit is contained in:
parent
dad1c819fd
commit
8fbb5ea624
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
exec /usr/local/bin/auto-cpufreq --daemon
|
||||
|
|
@ -0,0 +1 @@
|
|||
longrun
|
Loading…
Reference in New Issue