diff --git a/z8102/Makefile b/z8102/Makefile new file mode 100644 index 0000000000..c2b1ab0e00 --- /dev/null +++ b/z8102/Makefile @@ -0,0 +1,38 @@ +# +# Copyright (C) 2018-2023 Ycarus (Yannick Chabanois) for OpenMPTCProuter +# +# Originally made by DairyMan@Whirlpool come from https://github.com/ofmodemsandmen/ROOterSource2305/tree/main/package/rooter/0routerspecfic/z8102 +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=z8102 +PKG_VERSION:=0.1 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Yannick Chabanois + +include $(INCLUDE_DIR)/package.mk + +define Package/z8102 + SECTION:=OMR + CATEGORY:=OpenMPTCProuter + TITLE:=Install scripts for z8102 + PKGARCH:=all +endef + +define Package/z8102/description + Helper scripts to install scripts for z8102 +endef + + +define Build/Compile +endef + +define Package/z8102/install + $(CP) ./files/* $(1)/ + + +endef + +$(eval $(call BuildPackage,z8102)) diff --git a/z8102/files/etc/init.d/z8102 b/z8102/files/etc/init.d/z8102 new file mode 100755 index 0000000000..6a0e133cdd --- /dev/null +++ b/z8102/files/etc/init.d/z8102 @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2013 OpenWrt.org + +START=58 +USE_PROCD=1 + +log() { + logger -t "z8102" "$@" +} + +start_service() +{ + i=459 + echo $i > /sys/class/gpio/export + echo "out" > /sys/class/gpio/gpio${i}/direction + echo "1" > /sys/class/gpio/gpio${i}/value + i=460 + echo $i > /sys/class/gpio/export + echo "out" > /sys/class/gpio/gpio${i}/direction + echo "1" > /sys/class/gpio/gpio${i}/value + i=461 + echo $i > /sys/class/gpio/export + echo "out" > /sys/class/gpio/gpio${i}/direction + echo "0" > /sys/class/gpio/gpio${i}/value + i=462 + echo $i > /sys/class/gpio/export + echo "out" > /sys/class/gpio/gpio${i}/direction + echo "0" > /sys/class/gpio/gpio${i}/value + /usr/lib/custom/wdg.sh & +} diff --git a/z8102/files/usr/lib/custom/wdg.sh b/z8102/files/usr/lib/custom/wdg.sh new file mode 100755 index 0000000000..c583dac727 --- /dev/null +++ b/z8102/files/usr/lib/custom/wdg.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +i=457 +echo $i > /sys/class/gpio/export +echo "out" > /sys/class/gpio/gpio${i}/direction + +while true +do + echo "1" > /sys/class/gpio/gpio${i}/value + sleep 1 + echo "0" > /sys/class/gpio/gpio${i}/value + sleep 1 +done \ No newline at end of file