Skip to content

Commit

Permalink
Add z8102 watchdog package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Nov 5, 2023
1 parent c6835d3 commit 170ef44
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
38 changes: 38 additions & 0 deletions z8102/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# Copyright (C) 2018-2023 Ycarus (Yannick Chabanois) <[email protected]> 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 <[email protected]>

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))
30 changes: 30 additions & 0 deletions z8102/files/etc/init.d/z8102
Original file line number Diff line number Diff line change
@@ -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 &
}
13 changes: 13 additions & 0 deletions z8102/files/usr/lib/custom/wdg.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 170ef44

Please sign in to comment.