-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
|
||
echo "Starting the installation process..." | ||
|
||
# Checking and installing required packages | ||
REQUIRED_PACKAGES="kmod-sched ip-full kmod-veth tc" | ||
for pkg in $REQUIRED_PACKAGES; do | ||
if ! opkg list-installed | grep -q "^$pkg "; then | ||
echo "Installing $pkg..." | ||
opkg update && opkg install "$pkg" | ||
fi | ||
done | ||
|
||
echo "Downloading and setting up scripts..." | ||
|
||
# Download and set execution permissions for the scripts | ||
wget -O /etc/SimpleHFSCgamerscript.sh https://raw.githubusercontent.com/dlakelan/routerperf/nftables/SimpleHFSCgamerscript.sh && chmod a+x /etc/SimpleHFSCgamerscript.sh | ||
wget -O /etc/hotplug.d/iface/13-SimpleHFSCGamerScriptHotplug https://raw.githubusercontent.com/dlakelan/routerperf/nftables/13-SimpleHFSCGamerScriptHotplug | ||
mkdir -p /usr/share/nftables.d/ruleset-post/ && wget -O /usr/share/nftables.d/ruleset-post/dscptag.nft https://raw.githubusercontent.com/dlakelan/routerperf/nftables/dscptag.nft | ||
|
||
echo "Configuring veth interface..." | ||
|
||
# Configure the veth interface | ||
uci set network.veth=interface | ||
uci set network.veth.proto='none' | ||
uci set network.veth.ifname='lanveth' | ||
uci set network.veth.device='lanveth' | ||
uci commit network | ||
|
||
echo "Checking for LAN firewall zone and adding veth interface if it exists..." | ||
|
||
LAN_ZONE_NAME=$(uci show firewall | grep -E "firewall.@zone\[.*\].name='lan'" | cut -d'.' -f2) | ||
if [ ! -z "$LAN_ZONE_NAME" ]; then | ||
uci add_list firewall.$LAN_ZONE_NAME.network='veth' | ||
uci commit firewall | ||
/etc/init.d/firewall reload | ||
echo "veth interface added to LAN firewall zone." | ||
else | ||
echo "LAN firewall zone does not exist, skipping addition." | ||
fi | ||
|
||
echo "Reloading network service..." | ||
/etc/init.d/network reload | ||
|
||
echo "Installation completed successfully!" |