-
Notifications
You must be signed in to change notification settings - Fork 3.9k
nut: bump version and do some spring cleaning #29390
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
Closed
danielfdickinson
wants to merge
9
commits into
openwrt:master
from
danielfdickinson:pr-nut-update-version
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2af4930
nut: standardize scripts -- format and lint them
danielfdickinson 3c12349
nut: bump to 2.8.5
danielfdickinson 21ff3e8
nut: bump OpenWrt copyright for files with it
danielfdickinson 12ee7db
nut: move drivers to libexec
danielfdickinson cf78ca0
nut: add version test overrides
danielfdickinson 4d8027f
nut: split nut-server initscript for easier code review
danielfdickinson 0f0e289
nut: refactor nut-server scripts to reduce duplication
danielfdickinson 60a614f
nut: tweak shellcheck directives
danielfdickinson aca9f48
nut: tweak startup logging
danielfdickinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/bin/sh /etc/rc.common | ||
|
|
||
| # Common helper functions for NUT server initscript | ||
|
|
||
| # shellcheck shell=ash | ||
|
|
||
| # config_load nut_server is already called by sourcing script | ||
|
|
||
| # Store path for NUT working data in the global variable STATEPATH | ||
| srv_statepath() { | ||
| local statepath | ||
|
|
||
| config_get statepath upsd statepath /var/run/nut | ||
| STATEPATH="$statepath" | ||
| } | ||
|
|
||
| # Store user under which to run server (upsd) and driver processes in | ||
| # global variable 'RUNAS' | ||
| srv_runas() { | ||
| local runas | ||
|
|
||
| [ -n "$RUNAS" ] && return 0 | ||
|
|
||
| config_get runas upsd runas nut | ||
| RUNAS="$runas" | ||
| } | ||
|
|
||
| prevent_hotplug_restart() { | ||
| # Avoid hotplug inadvertently restarting driver during | ||
| # forced shutdown | ||
|
|
||
| srv_statepath | ||
|
|
||
| [ -f /var/run/killpower ] && return 0 | ||
| if [ -d "${STATEPATH}" ] && [ -f "${STATEPATH}"/disable-hotplug ]; then | ||
| return 0 | ||
| fi | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.