From efeab1c569096a415f4fcb786f4188324f902de4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 16 Jan 2020 19:10:59 -0800 Subject: [PATCH] i2pd: Update to 2.29.0 Ran init script through shellcheck. Simplified several statements. Replaced INSTALL_CONF with INSTALL_DATA. i2pd runs as non-root and so the conf file must be accessible. Fixed: https://github.com/openwrt/packages/issues/10977 Signed-off-by: Rosen Penev --- net/i2pd/Makefile | 4 ++-- net/i2pd/files/i2pd.init | 22 ++++++++-------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/net/i2pd/Makefile b/net/i2pd/Makefile index 09aafa5a4..1335194c3 100644 --- a/net/i2pd/Makefile +++ b/net/i2pd/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=i2pd -PKG_VERSION:=2.28.0 +PKG_VERSION:=2.29.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:=181327edc7cf5b3c25ee51ecc518a4da90fa9e421eca2107996791038a514a21 +PKG_HASH:=fd0474c33b411593b9dc8197f3799d37d68455c11a9ee3994ec993a96388ec06 PKG_MAINTAINER:=David Yang PKG_LICENSE:=BSD-3-Clause diff --git a/net/i2pd/files/i2pd.init b/net/i2pd/files/i2pd.init index 21473407f..4c4790fc3 100755 --- a/net/i2pd/files/i2pd.init +++ b/net/i2pd/files/i2pd.init @@ -27,20 +27,18 @@ i2pd_start() { config_get addressbook_dir "$cfg" addressbook_dir ## Setting up data dir - if [ ! -d "$data_dir" ]; then + [ -d "$data_dir" ] || { mkdir -p "$data_dir" + chown "$USER:$GROUP" "$data_dir" ln -s /usr/share/i2pd/certificates "$data_dir/certificates" - if [ -n "$addressbook_dir" ]; then - if [ ! -d "$addressbook_dir" ]; then - mkdir -p "$addressbook_dir" - fi + [ -n "$addressbook_dir" ] && { + [ -d "$addressbook_dir" ] || mkdir -p "$addressbook_dir" + chown "$USER:$GROUP" "$addressbook_dir" ln -s "$addressbook_dir" "$data_dir/addressbook" - fi - fi + } + } ## We need permissions - chown "$USER:$GROUP" "$data_dir" - chown "$USER:$GROUP" "$addressbook_dir" touch "$PIDFILE" chown "$USER:adm" "$PIDFILE" @@ -67,11 +65,7 @@ start_service() { config_cb() { local type="$1" local name="$2" - if [ "$type" = "i2pd" ]; then - if [ -n "$instance" ] && [ "$instance" = "$name" ]; then - instance_found=1 - fi - fi + [ "$type" = "i2pd" ] && [ -n "$instance" ] && [ "$instance" = "$name" ] && instance_found=1 } config_load i2pd