mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
add netmasker
This commit is contained in:
parent
d155e9a8ad
commit
ea3e086b1d
5 changed files with 431 additions and 0 deletions
93
netmaker-openwrt/netmaker/Makefile
Normal file
93
netmaker-openwrt/netmaker/Makefile
Normal file
|
@ -0,0 +1,93 @@
|
|||
#
|
||||
# Copyright (C) 2019 sbilly <superli_1980@hotmail.com>
|
||||
#
|
||||
# This is free software, licensed under the MIT License.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netmaker
|
||||
PKG_VERSION:=0.9.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/gravitl/netmaker.git
|
||||
PKG_SOURCE_VERSION:=e9bce264719f88c30e252ecc754d08f422f4c080
|
||||
PKG_SOURCE_DATE:=20220117
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=sbilly <superli_1980@hotmail.com>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/gravitl/netmaker
|
||||
GO_PKG_INSTALL_EXTRA:=extra/file extra/dir
|
||||
GO_PKG_EXCLUDES:=excluded
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/netmaker
|
||||
$(call Package/netmaker/Default)
|
||||
$(call GoPackage/GoSubMenu)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=VPN
|
||||
endef
|
||||
|
||||
define Package/netmaker/Default
|
||||
TITLE:=Netmaker for OpenWRT
|
||||
URL:=https://github.com/gravitl/netmaker
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
MAINTAINER:=sbilly <superli_1980@hotmail.com>
|
||||
endef
|
||||
|
||||
define Package/netmaker/Default/description
|
||||
Netmaker is a platform for creating and managing fast, secure, and
|
||||
dynamic virtual overlay networks using WireGuard. This project offers
|
||||
OpenWRT packages for Netmaker.
|
||||
endef
|
||||
|
||||
define Package/netmaker/description
|
||||
$(call Package/netmaker/Default/description)
|
||||
|
||||
This package contains the binaries.
|
||||
endef
|
||||
|
||||
define Package/netmaker-dev
|
||||
TITLE+= (source files)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=VPN
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/netmaker-dev/description
|
||||
$(call Package/netmaker/Default/description)
|
||||
|
||||
This package provides the source files.
|
||||
endef
|
||||
|
||||
define Package/netmaker/install
|
||||
$(INSTALL_DIR) $(1)/etc/netclient/
|
||||
$(INSTALL_DIR) $(1)/etc/netclient/config
|
||||
$(INSTALL_DIR) $(1)/etc/systemd/
|
||||
$(INSTALL_DIR) $(1)/etc/systemd/system
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/netmaker $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/netclient $(1)/usr/bin/
|
||||
$(CP) ./root/* $(1)/
|
||||
$(LN) netclient $(1)/etc/netclient/netclient
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,netmaker))
|
||||
$(eval $(call BuildPackage,netmaker))
|
||||
|
||||
$(eval $(call GoSrcPackage,netmaker-dev))
|
||||
$(eval $(call BuildPackage,netmaker-dev))
|
42
netmaker-openwrt/netmaker/root/etc/init.d/netclient
Normal file
42
netmaker-openwrt/netmaker/root/etc/init.d/netclient
Normal file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
#Created by oycol<oycol527@outlook.com>
|
||||
|
||||
EXTRA_COMMANDS="status"
|
||||
EXTRA_HELP=" status Check service is running"
|
||||
START=99
|
||||
|
||||
LOG_FILE="/tmp/netclient.logs"
|
||||
|
||||
start() {
|
||||
mkdir -p /etc/netclient/config
|
||||
mkdir -p /etc/systemd/system
|
||||
|
||||
if [ ! -f "${LOG_FILE}" ];then
|
||||
touch "${LOG_FILE}"
|
||||
fi
|
||||
local PID=$(ps|grep "netclient checkin -n all"|grep -v grep|awk '{print $1}')
|
||||
if [ "${PID}" ];then
|
||||
echo "service is running"
|
||||
return
|
||||
fi
|
||||
/bin/sh -c "while [ 1 ]; do netclient checkin -n all >> ${LOG_FILE} 2>&1;sleep 15;\
|
||||
if [ $(ls -l ${LOG_FILE}|awk '{print $5}') -gt 10240000 ];then tar zcf "${LOG_FILE}.tar" -C / "tmp/netclient.logs" && > $LOG_FILE;fi;done &"
|
||||
echo "start"
|
||||
}
|
||||
|
||||
stop() {
|
||||
local PID=$(ps|grep "netclient checkin -n all"|grep -v grep|awk '{print $1}')
|
||||
if [ "${PID}" ];then
|
||||
kill "${PID}"
|
||||
fi
|
||||
echo "stop"
|
||||
}
|
||||
|
||||
status() {
|
||||
local PID=$(ps|grep "netclient checkin -n all"|grep -v grep|awk '{print $1}')
|
||||
if [ "${PID}" ];then
|
||||
echo -e "netclient[${PID}] is running \n"
|
||||
else
|
||||
echo -e "netclient is not running \n"
|
||||
fi
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue