-
-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
self-updating runit file #500
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
#!/bin/sh | ||
exec /usr/local/bin/auto-cpufreq --daemon | ||
# test for update | ||
if git -c advice.detachedHead=false pull -v https://github.com/AdnanHodzic/auto-cpufreq.git | grep -q -v '^\s*\(Updating\|Already up-to-date\|From\s\)\s'; then | ||
exit | ||
else | ||
# install the update | ||
echo "i" | sudo ~/auto-cpufreq/auto-cpufreq-installer && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A runit service is run as root (unless it is a user service, which are rare, not enabled by default, a bit difficult to set up and the least common way services are used in runit). Using Where is Why is |
||
notify-send -a "auto-cpufreq" "Update installed" && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
# wait a bit to make sure its ready | ||
sleep 1000 | ||
fi | ||
|
||
# run the daemon | ||
exec /usr/bin/auto-cpufreq --daemon 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no guarantee that
git
exists. The script should check for dependencies likegit
andsudo
mentioned below and act approprietly.Where is
git
pulling to exactly?