-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix typo in package name deferable-reboot -> deferrable-reboot
- Loading branch information
Showing
15 changed files
with
58 additions
and
58 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
packages/deferable-reboot/files/usr/bin/deferable-reboot-check
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -9,29 +9,29 @@ include $(TOPDIR)/rules.mk | |
GIT_COMMIT_DATE:=$(shell git log -n 1 --pretty=%ad --date=short . ) | ||
GIT_COMMIT_TSTAMP:=$(shell git log -n 1 --pretty=%at . ) | ||
|
||
PKG_NAME:=deferable-reboot | ||
PKG_NAME:=deferrable-reboot | ||
PKG_VERSION=$(GIT_COMMIT_DATE)-$(GIT_COMMIT_TSTAMP) | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/$(PKG_NAME) | ||
SECTION:=utils | ||
CATEGORY:=Utilities | ||
TITLE:=$(PKG_NAME) provides a deferable reboot. | ||
TITLE:=$(PKG_NAME) provides a deferrable reboot. | ||
MAINTAINER:=Santiago Piccinini <[email protected]> | ||
DEPENDS:=+lua +lime-system | ||
PKGARCH:=all | ||
endef | ||
|
||
define Package/$(PKG_NAME)/description | ||
This $(PKG_NAME) provides a deferable reboot mechanism. The system | ||
This $(PKG_NAME) provides a deferrable reboot mechanism. The system | ||
will be rebooted when the uptime of the system reach a specified amount | ||
of seconds and if /tmp/deferable-reboot.defer file does not contain a | ||
of seconds and if /tmp/deferrable-reboot.defer file does not contain a | ||
number that is greater than the current uptime. | ||
This way if anyone wants to postpone the reboot, the way is to store the | ||
next checkpoint in seconds. For example if the system must not reboot from | ||
now and up to 120 seconds in the future then something like this can be donde | ||
awk '{print $1 + 120}' /proc/uptime > /tmp/deferable-reboot.defer | ||
awk '{print $1 + 120}' /proc/uptime > /tmp/deferrable-reboot.defer | ||
endef | ||
|
||
define Build/Configure | ||
|
3 changes: 3 additions & 0 deletions
3
packages/deferrable-reboot/files/etc/config/deferrable-reboot
This file contains 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 @@ | ||
config deferrable-reboot 'options' | ||
#option deferrable_reboot_uptime '97200' | ||
|
File renamed without changes.
This file contains 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
10 changes: 10 additions & 0 deletions
10
packages/deferrable-reboot/files/usr/bin/deferrable-reboot
This file contains 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,10 @@ | ||
#!/usr/bin/lua | ||
|
||
local defreboot = require 'deferrable_reboot' | ||
|
||
defreboot.config() | ||
|
||
if defreboot.should_reboot() then | ||
os.execute('logger -t deferrable-reboot -p ALERT Rebooting in 30 seconds!') | ||
defreboot.reboot() | ||
end |
17 changes: 17 additions & 0 deletions
17
packages/deferrable-reboot/files/usr/bin/deferrable-reboot-check
This file contains 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,17 @@ | ||
#!/bin/sh | ||
|
||
uci_config_path="lime-autogen.system.deferrable_reboot_ping_target" | ||
target=$(uci -q get $uci_config_path &> /dev/null) | ||
|
||
if [ -n "$target" ]; then | ||
if ping -c 10 -W 10 $target; then | ||
action=defer | ||
fi | ||
else | ||
echo "deferrable-reboot: Could not get the ping target from UCI $uci_config_path, deferring anyway" | ||
action=defer | ||
fi | ||
|
||
if [ "$action" == "defer" ]; then | ||
awk '{print $1 + 1800}' /proc/uptime > /tmp/deferrable-reboot.defer | ||
fi |
This file contains 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 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 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 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 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 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