Verify the use of supported init systems. (#303)

This commit is contained in:
bobslept 2021-12-08 07:50:40 +01:00 committed by GitHub
parent 1909cc87c1
commit 342e5fab86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -55,7 +55,7 @@ if [ "$(ps h -o comm 1)" = "runit" ];then
esac
fi
# Install script for systemd
else
elif [ "$(ps h -o comm 1)" = "systemd" ];then
echo -e "\n* Deploy auto-cpufreq systemd unit file"
cp /usr/local/share/auto-cpufreq/scripts/auto-cpufreq.service /etc/systemd/system/auto-cpufreq.service
@ -70,4 +70,7 @@ else
echo -e "\n* Enabling auto-cpufreq daemon (systemd) service at boot"
systemctl 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"
fi

View File

@ -36,7 +36,8 @@ if [ "$(ps h -o comm 1)" = "runit" ];then
esac
fi
else
# Remove service for systemd
elif [ "$(ps h -o comm 1)" = "systemd" ];then
echo -e "\n* Stopping auto-cpufreq daemon (systemd) service"
systemctl stop auto-cpufreq
@ -51,4 +52,7 @@ else
echo -e "reset failed"
systemctl reset-failed
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"
fi