add custom scripts

This commit is contained in:
Anime4000 2022-09-08 23:09:59 +08:00
parent ada3a603a5
commit e63a2decb4
7 changed files with 2280 additions and 1 deletions

View File

@ -121,7 +121,17 @@ rm "$CHDIR/home/httpd/web/admin/graphics/topbar.gif"
cd "$CHDIR/home/httpd/web/admin/graphics"
ln -s "../../graphics/topbar.gif" "topbar.gif"
ln -s "../../graphics/router.gif" "router.gif"
cd "$DIR/${FILENAME%.*}"
cd "$DIR/${FILENAME%.*}"
if [ -d "$DIR/custom/etc" ]; then
echo "Injecting custom or fix scripts"
cp -rf "$DIR/custom/etc" "$CHDIR/etc"
fi
if [ -f "$CHDIR/etc/scripts/fix_sw_ver.sh" ]; then
echo "Injecting software version fix scripts"
find "$CHDIR/etc/init.d" -type f -exec sed -i 's/\/etc\/insdrv.sh/\/etc\/insdrv.sh\n\/etc\/scripts\/fix_sw_ver.sh/g' {} +
fi
echo "chmod +x /bin folder, prevent stick become brick!"
chmod +x "$CHDIR/bin" -R

View File

@ -0,0 +1,10 @@
#!/bin/sh
# HiSGMII Speed: Fix upload speed when using HiSGMII mode
# By stich86
SPEED=$(flash get LAN_SDS_MODE | awk -F'=' '{print $2}')
if [ "$SPEED" == "4" ] || [ "$SPEED" == "5" ] || [ "$SPEED" == "6" ]; then
/bin/diag bandwidth set egress port all rate 4194296
/bin/diag bandwidth set ingress port all rate 4194296
fi

View File

@ -0,0 +1,21 @@
#!/bin/sh
# Software Version: Allow user to use custom Software Version when using ODI Stick
# By stich86, Anime4000
OLT_MODE=$(flash get OMCI_OLT_MODE | awk -F'=' '{print $2}')
SWVER0=$(/bin/nv getenv sw_custom_version0 | awk -F'=' '{print $2}')
SWVER1=$(/bin/nv getenv sw_custom_version1 | awk -F'=' '{print $2}')
# Check if custom nv value is exist
if [ -z "$SWVER0" ]; then
SWVER0=$(/bin/nv getenv sw_version0 | awk -F'=' '{print $2}')
fi
if [ -z "$SWVER1" ]; then
SWVER1=$(/bin/nv getenv sw_version1 | awk -F'=' '{print $2}')
fi
# Apply custom Software Version when using OMCI_OLT_MODE 3
if [ "$OLT_MODE" == "3" ]; then
flash set OMCI_SW_VER1 $SWVER0
flash set OMCI_SW_VER2 $SWVER1
fi

View File

@ -0,0 +1,26 @@
#!/bin/sh
# VLAN Tag Fix: Fix VLAN wrong mapping
# By inyourgroove
set -e
while true; do
omcicli mib get 84 > /tmp/84.tmp
size=$(ls -la /tmp/ | grep 84.tmp | awk '{ print $5 }')
if [[ "$size" -lt "88" ]]; then
# Looks like the table is not populated yet
sleep 30
continue
fi
one_mode=$(awk '/0x1102/{nr[NR]; nr[NR+2]}; NR in nr' /tmp/84.tmp | grep FwdOp | awk '{ print $2 }')
two_mode=$(awk '/0x110b/{nr[NR]; nr[NR+2]}; NR in nr' /tmp/84.tmp | grep FwdOp | awk '{ print $2 }')
rm /tmp/84.tmp
[[ $one_mode != "0x02" ]] && omcicli mib set 84 4354 FwdOp 0x02
[[ $two_mode != "0x02" ]] && omcicli mib set 84 4363 FwdOp 0x02
sleep 30
done;

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.