Skip to content

Commit

Permalink
add s6 script for auto-cpufreq install (#421)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
AnasR7 and Anas committed Aug 15, 2022
1 parent dad1c81 commit 8fbb5ea
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/auto-cpufreq-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions scripts/auto-cpufreq-remove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions scripts/auto-cpufreq-s6/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

exec /usr/local/bin/auto-cpufreq --daemon

1 change: 1 addition & 0 deletions scripts/auto-cpufreq-s6/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
longrun

0 comments on commit 8fbb5ea

Please sign in to comment.