-
Notifications
You must be signed in to change notification settings - Fork 19
Add support for ietf-schedule #1523
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
Merged
troglobit
merged 3 commits into
kernelkit:main
from
saba8814:feat/add-scheduler-support
Jun 18, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| if [ -s /run/os-update ]; then | ||
| printf '\n\033[1;33m *** %s ***\033[0m\n\n' "$(cat /run/os-update)" | ||
| fi |
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 @@ | ||
| f /run/os-update 0666 admin admin |
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,55 @@ | ||
| #!/bin/sh | ||
| # Check for available software updates and notify on login if one exists. | ||
| # Called by the scheduler. | ||
|
|
||
| NOTIFY_FILE=/run/os-update | ||
| TAG=os-update | ||
|
|
||
| # Source os-release for VERSION and IMAGE_ID | ||
| if [ ! -f /etc/os-release ]; then | ||
| logger -t "$TAG" "ERROR: /etc/os-release not found" | ||
| exit 1 | ||
| fi | ||
| . /etc/os-release | ||
|
|
||
| # Dev/dirty builds have no comparable semver — always show the latest release | ||
| IS_RELEASE=true | ||
| if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+'; then | ||
| IS_RELEASE=false | ||
| fi | ||
|
|
||
| # Read configured update-url from running config, fall back to upstream | ||
| UPDATE_URL=$(copy running-config \ | ||
| -x '/ietf-system:system/infix-system:software/check-update/update-url' \ | ||
| 2>/dev/null \ | ||
| | jq -r '.. | objects | ."update-url"? // empty') | ||
| UPDATE_URL=${UPDATE_URL:-"https://github.com/kernelkit/infix"} | ||
|
|
||
| # Derive API URL from the configured update URL. | ||
| # Default (github.com): https://github.com/org/repo → https://api.github.com/repos/org/repo | ||
| REPO=$(echo "$UPDATE_URL" | sed 's|https://github.com/||; s|/*$||') | ||
| API_URL="https://api.github.com/repos/${REPO}/releases/latest" | ||
|
|
||
| LATEST_TAG=$(curl -sSL --max-time 10 "$API_URL" 2>/dev/null \ | ||
| | jq -r '.tag_name // empty') | ||
| if [ -z "$LATEST_TAG" ]; then | ||
| logger -p daemon.info -t "$TAG" "Update check skipped: could not reach ${API_URL}" | ||
| exit 0 | ||
| fi | ||
| LATEST=${LATEST_TAG#v} | ||
|
|
||
| # Compare: is $1 strictly newer than $2? | ||
| newer() { | ||
| [ "$1" = "$2" ] && return 1 | ||
| [ "$(printf '%s\n%s' "$1" "$2" | sort -V | tail -1)" = "$1" ] | ||
| } | ||
|
|
||
| if [ "$IS_RELEASE" = false ] || newer "$LATEST" "$VERSION"; then | ||
| RELEASE_URL="${UPDATE_URL}/releases/${LATEST_TAG}" | ||
| MSG="Software update available: ${LATEST_TAG}, running ${VERSION} (see ${RELEASE_URL})" | ||
| logger -t "$TAG" "$MSG" | ||
| printf '%s\n' "$MSG" > "$NOTIFY_FILE" | ||
| else | ||
| logger -p daemon.debug -t "$TAG" "No update available (current: $VERSION, latest: $LATEST)" | ||
| printf '' > "$NOTIFY_FILE" | ||
| fi |
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,2 @@ | ||
| # Cron daemon for infix-schedule | ||
| service [2345] crond -f -- Cron daemon |
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
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.