From c237990dd0ac444ce3b401a92140c9828a3f868e Mon Sep 17 00:00:00 2001 From: David Yang Date: Mon, 3 Jun 2019 22:44:29 +0800 Subject: [PATCH] i2pd: Update to 2.26.0 Signed-off-by: David Yang --- net/i2pd/Makefile | 4 ++-- net/i2pd/files/i2pd.init | 34 +++++++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/net/i2pd/Makefile b/net/i2pd/Makefile index 20708c0274..4775365d18 100644 --- a/net/i2pd/Makefile +++ b/net/i2pd/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=i2pd -PKG_VERSION:=2.24.0 +PKG_VERSION:=2.26.0 PKG_RELEASE:=1 PKG_BUILD_PARALLEL:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/PurpleI2P/i2pd/tar.gz/$(PKG_VERSION)? -PKG_HASH:=809b37100f0f176432b01ab6edee96dc62b0f65d5bf7531e008a87117e742566 +PKG_HASH:=2ae18978c8796bb6b45bc8cfe4e1f25377e0cfc9fcf9f46054b09dc3384eef63 PKG_MAINTAINER:=David Yang PKG_LICENSE:=BSD-3-Clause diff --git a/net/i2pd/files/i2pd.init b/net/i2pd/files/i2pd.init index 4af1013637..a40a742050 100755 --- a/net/i2pd/files/i2pd.init +++ b/net/i2pd/files/i2pd.init @@ -18,14 +18,13 @@ CONFFILE=/etc/i2pd/i2pd.conf -start_service() { +i2pd_start() { + local cfg="$1" local data_dir local addressbook_dir - config_load i2pd - - config_get data_dir i2pd data_dir - config_get addressbook_dir i2pd addressbook_dir + config_get data_dir "$cfg" data_dir + config_get addressbook_dir "$cfg" addressbook_dir ## Setting up data dir if [ ! -d "$data_dir" ]; then @@ -57,3 +56,28 @@ start_service() { procd_set_param pidfile "$PIDFILE" procd_close_instance } + + +start_service() { + local instance="$1" + local instance_found=0 + + config_cb() { + local type="$1" + local name="$2" + if [ "$type" = "i2pd" ]; then + if [ -n "$instance" ] && [ "$instance" = "$name" ]; then + instance_found=1 + fi + fi + } + + config_load i2pd + + if [ -n "$instance" ]; then + [ "$instance_found" -gt 0 ] || return + i2pd_start "$instance" + else + config_foreach i2pd_start i2pd + fi +} -- 2.30.2