mirror of
https://github.com/kenzok8/openwrt-packages.git
synced 2025-11-01 08:18:52 +08:00
update 2022-04-11 16:22:56
This commit is contained in:
47
gost/Makefile
Normal file
47
gost/Makefile
Normal file
@ -0,0 +1,47 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2021 ImmortalWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gost
|
||||
PKG_VERSION:=2.11.2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ginuerzh/gost/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=143174a9ba5b0b6251d1d9a52267220f97bec1319676618746c1a5d7a7a86d96
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILE:=LICENSE
|
||||
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/ginuerzh/gost
|
||||
GO_PKG_BUILD_PKG:=github.com/ginuerzh/gost/cmd/gost
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/gost
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=GO Simple Tunnel
|
||||
URL:=https://github.com/ginuerzh/gost
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
||||
endef
|
||||
|
||||
define Package/gost/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(CURDIR)/files/gost.config $(1)/etc/config/gost
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(CURDIR)/files/gost.init $(1)/etc/init.d/gost
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,gost))
|
||||
$(eval $(call BuildPackage,gost))
|
||||
5
gost/files/gost.config
Normal file
5
gost/files/gost.config
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
config gost
|
||||
option enable '0'
|
||||
option run_command ''
|
||||
|
||||
22
gost/files/gost.init
Executable file
22
gost/files/gost.init
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Created By ImmortalWrt
|
||||
# https://github.com/project-openwrt
|
||||
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
enable="$(uci get gost.@gost[0].enable)"
|
||||
run_command="$(uci get gost.@gost[0].run_command)"
|
||||
|
||||
start()
|
||||
{
|
||||
stop
|
||||
|
||||
[ "${enable}" -ne "1" ] && exit 0
|
||||
/usr/bin/gost ${run_command} &
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
killall -9 "gost" > "/dev/null" 2>&1
|
||||
}
|
||||
Reference in New Issue
Block a user