diff --git a/README.md b/README.md index a608af4..333c59a 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,6 @@ Add this line in your `feeds.conf.default`: src-git glorytun https://github.com/angt/glorytun-openwrt.git -Or install in `package`: - - $ git clone https://github.com/angt/glorytun-openwrt.git - $ cp -rf glorytun-openwrt/glorytun package - Update and install your feeds: $ ./scripts/feeds update -a diff --git a/glorytun/Makefile b/glorytun/Makefile index 3adbd12..a214eb7 100644 --- a/glorytun/Makefile +++ b/glorytun/Makefile @@ -1,34 +1,34 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glorytun -PKG_VERSION:=0.1.1 +PKG_VERSION:=0.2.2 PKG_RELEASE:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/angt/$(PKG_NAME)/releases/download/v$(PKG_VERSION) -PKG_HASH:=d67a5765fb4d6c43a2e0e3e83887cd036568bbf76f65df9f1561dc82a08800b9 +PKG_HASH:=457552232c72d5fec7ba46382784685c2e8167d49d8182ab3afbfb2b0bce1b01 PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME) - SECTION:=net - CATEGORY:=Network - SUBMENU:=VPN - TITLE:=Glorytun - DEPENDS:=+kmod-tun +libsodium +librt - URL:=https://github.com/angt/glorytun +SECTION:=net +CATEGORY:=Network +SUBMENU:=VPN +TITLE:=Glorytun +DEPENDS:=+kmod-tun +libsodium +librt +URL:=https://github.com/angt/glorytun endef TARGET_CPPFLAGS += -DGT_RUNDIR=\\\"/var/run/$(PKG_NAME)\\\" define Package/$(PKG_NAME)/description - Glorytun is a vpn designed to improve your internet connectivity: - - Fast and highly secure. - - Multipath and active failover. - - Traffic shaping. - - Path MTU discovery without ICMP. +Glorytun is a vpn designed to improve your internet connectivity: + - Fast and highly secure. + - Multipath and active failover. + - Traffic shaping. + - Path MTU discovery without ICMP. endef define Package/$(PKG_NAME)/conffiles diff --git a/glorytun/init b/glorytun/init index 52b0c12..a04e2c5 100755 --- a/glorytun/init +++ b/glorytun/init @@ -1,14 +1,27 @@ #!/bin/sh /etc/rc.common +# shellcheck disable=SC2039 +# vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 : -START=90 -STOP=10 -USE_PROCD=1 +# shellcheck disable=SC2034 +{ + START=90 + STOP=10 + USE_PROCD=1 +} PROG_NAME=glorytun PROG=/usr/sbin/$PROG_NAME +_log() { + logger -p daemon.info -t $PROG_NAME "$@" +} + +_err() { + logger -p daemon.err -t $PROG_NAME "$@" +} + validate_section() { - uci_validate_section $PROG_NAME $PROG_NAME "$1" \ + uci_validate_section glorytun mud "$1" \ 'enable:bool:0' \ 'key:string' \ 'server:host' \ @@ -19,8 +32,12 @@ validate_section() { start_instance() { local enable key server port dev - validate_section "$1" || return - [ "$enable" = "1" ] || return 0 + validate_section "$1" || { + _err "validation failed" + return 1 + } + + [ "$enable" = "1" ] || return [ "$key" ] || return [ "$server" ] || return [ "$port" ] || return @@ -29,6 +46,8 @@ start_instance() { ( umask 077; echo "$key" > "$keyfile" ) key="" + _log "starting $PROG_NAME instance $*" + procd_open_instance procd_set_param command $PROG \