This commit is contained in:
TriForceX
2021-03-13 22:13:38 -03:00
parent c77595adbd
commit b3ecc6e32d
7043 changed files with 119377 additions and 73694 deletions

View File

@@ -0,0 +1,8 @@
config BR2_PACKAGE_HTPDATE
bool "htpdate"
depends on BR2_USE_MMU # fork()
help
The HTTP Time Protocol (HTP) is used to synchronize a
computer's time with web servers as reference time source.
https://github.com/angeloc/htpdate

View File

@@ -0,0 +1,51 @@
#!/bin/sh
DAEMON="htpdate"
PIDFILE="/var/run/$DAEMON.pid"
HTPDATE_ARGS="-a -s -t https://google.com"
test -r "/etc/default/$DAEMON" && . "/etc/default/$DAEMON"
start() {
printf 'Starting %s: ' "$DAEMON"
# shellcheck disable=SC2086 # we need the word splitting
start-stop-daemon -S -q -x "/usr/bin/$DAEMON" \
-- -D -i "$PIDFILE" $HTPDATE_ARGS
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
stop() {
printf 'Stopping %s: ' "$DAEMON"
start-stop-daemon -K -q -p "$PIDFILE"
status=$?
if [ "$status" -eq 0 ]; then
rm -f "$PIDFILE"
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
restart() {
stop
sleep 1
start
}
case "$1" in
start|stop|restart)
"$1";;
reload)
# Restart, since there is no true "reload" feature.
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac

View File

@@ -0,0 +1,3 @@
# Locally calculated:
sha256 267003ca4d5d191122bfd8f85a0fd2d0b7d751f7b04f5fde4e8f51e570c98d0b htpdate-1.2.5.tar.gz
sha256 b1c8d41afde943cacedab52cbb44ef7ffb7026e738b9c891009e89559fe31c20 LICENSE

View File

@@ -0,0 +1,35 @@
################################################################################
#
# htpdate
#
################################################################################
HTPDATE_VERSION = 1.2.5
HTPDATE_SITE = $(call github,angeloc,htpdate,v$(HTPDATE_VERSION))
HTPDATE_LICENSE = GPL-2.0+
HTPDATE_LICENSE_FILES = LICENSE
ifeq ($(BR2_PACKAGE_OPENSSL),y)
HTPDATE_BUILD_OPTS = ENABLE_HTTPS=1
HTPDATE_DEPENDENCIES += openssl host-pkgconf
endif
define HTPDATE_BUILD_CMDS
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(HTPDATE_BUILD_OPTS)
endef
define HTPDATE_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
endef
define HTPDATE_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/htpdate/S43htpdate \
$(TARGET_DIR)/etc/init.d/S43htpdate
endef
define HTPDATE_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 0644 package/htpdate/htpdate.service \
$(TARGET_DIR)/usr/lib/systemd/system/htpdate.service
endef
$(eval $(generic-package))

View File

@@ -0,0 +1,13 @@
[Unit]
Description=htpdate daemon
After=network.target
[Service]
Type=forking
PIDFile=/run/htpdate.pid
Environment=HTPDATE_ARGS="-a -s -t https://www.google.com"
EnvironmentFile=-/etc/default/htpdate
ExecStart=/usr/bin/htpdate -D -i /run/htpdate.pid $HTPDATE_ARGS
[Install]
WantedBy=multi-user.target