Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ae09159
Bump actions/checkout from 4.2.2 to 5.0.0 in the all-actions group
dependabot[bot] Aug 18, 2025
7c04cb1
Merge pull request #17 from AMTM-OSR/dependabot/github_actions/develo…
ExtremeFiretop Aug 18, 2025
863454d
Bump softprops/action-gh-release in the all-actions group
dependabot[bot] Sep 8, 2025
fe565d6
Merge pull request #18 from AMTM-OSR/dependabot/github_actions/develo…
ExtremeFiretop Sep 8, 2025
8e973ac
Bump softprops/action-gh-release in the all-actions group
dependabot[bot] Oct 6, 2025
3794568
Merge pull request #19 from AMTM-OSR/dependabot/github_actions/develo…
ExtremeFiretop Oct 6, 2025
5594ca3
Bump softprops/action-gh-release in the all-actions group
dependabot[bot] Oct 13, 2025
526e637
Merge pull request #20 from AMTM-OSR/dependabot/github_actions/develo…
Martinski4GitHub Oct 15, 2025
591f6f5
Update .gitattributes
Martinski4GitHub Oct 25, 2025
f904656
Merge pull request #21 from Martinski4GitHub/develop
Martinski4GitHub Oct 25, 2025
083efd1
Update .gitattributes
Martinski4GitHub Oct 26, 2025
726a87c
Merge pull request #22 from Martinski4GitHub/develop
Martinski4GitHub Oct 26, 2025
7f5c6c3
Removed Tomato JS Dependencies
Martinski4GitHub Oct 30, 2025
b4ca534
Merge pull request #23 from Martinski4GitHub/develop
Martinski4GitHub Oct 30, 2025
ff26f18
Code Improvements
Martinski4GitHub Oct 31, 2025
cedfaab
Merge pull request #24 from Martinski4GitHub/develop
Martinski4GitHub Oct 31, 2025
868ed75
Code Improvements
Martinski4GitHub Nov 5, 2025
931834d
Merge pull request #25 from Martinski4GitHub/develop
Martinski4GitHub Nov 5, 2025
048f980
Update README.md
Martinski4GitHub Nov 9, 2025
7000af2
Merge pull request #26 from Martinski4GitHub/develop
Martinski4GitHub Nov 9, 2025
5480df2
Merge branch 'master' into develop
Martinski4GitHub Nov 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
* text eol=lf
*.sh text eol=lf
*.md text eol=lf
*.asp text eol=lf
*.js text eol=lf
*.css text eol=lf
*.config.example text eol=lf
* text=auto eol=lf
*.gz binary
*.png binary
*.jpg binary
*.jpeg binary
*.zip binary
*.tar.gz binary
4 changes: 2 additions & 2 deletions .github/workflows/Create-NewReleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
# 1--- Check out master so we tag the exact merge commit
- name: Checkout source code
uses: actions/checkout@v4.2.2
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0
ref: 'master'
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
# 7--- Publish a GitHub Release with auto-generated notes
- name: Create Release with Automated Release Notes
uses: softprops/action-gh-release@v2.3.2
uses: softprops/action-gh-release@v2.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.nextver.outputs.tag }}
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# YazFi - enhanced AsusWRT-Merlin Guest WiFi Networks

## v4.4.8
### Updated on 2025-Jul-20
## v4.4.9
### Updated on 2025-Nov-08

## About
Feature expansion of guest WiFi networks on AsusWRT-Merlin, including, but not limited to:

Expand Down
149 changes: 93 additions & 56 deletions YazFi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
## Guest Network DHCP script and for ##
## AsusWRT-Merlin firmware ##
###################################################
# Last Modified: 2025-Jul-18
# Last Modified: 2025-Nov-04
#--------------------------------------------------

###### Shellcheck directives ######
Expand All @@ -41,10 +41,10 @@
### Start of script variables ###
readonly SCRIPT_NAME="YazFi"
readonly SCRIPT_CONF="/jffs/addons/$SCRIPT_NAME.d/config"
readonly YAZFI_VERSION="v4.4.8"
readonly SCRIPT_VERSION="v4.4.8"
readonly SCRIPT_VERSTAG="25071823"
SCRIPT_BRANCH="master"
readonly YAZFI_VERSION="v4.4.9"
readonly SCRIPT_VERSION="v4.4.9"
readonly SCRIPT_VERSTAG="25110423"
SCRIPT_BRANCH="develop"
SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH"
readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME.d"
readonly USER_SCRIPT_DIR="$SCRIPT_DIR/userscripts.d"
Expand All @@ -65,21 +65,13 @@ readonly BOLD="\\e[1m"
readonly SETTING="${BOLD}\\e[36m"
readonly CLEARFORMAT="\\e[0m"
readonly CLRct="\e[0m"
readonly REDct="\e[1;31m"
readonly GRNct="\e[1;32m"
readonly MGNTct="\e[1;35m"
### End of output format variables ###

### Start of router environment variables ###

##-------------------------------------##
## Added by Martinski W. [2025-Mar-16] ##
##-------------------------------------##
readonly scriptVersRegExp="v[0-9]{1,2}([.][0-9]{1,2})([.][0-9]{1,2})"
readonly webPageFileRegExp="user([1-9]|[1-2][0-9])[.]asp"
readonly webPageLineTabExp="\{url: \"$webPageFileRegExp\", tabName: "
readonly webPageLineRegExp="${webPageLineTabExp}\"$SCRIPT_NAME\"\},"
readonly branchx_TAG="Branch: $SCRIPT_BRANCH"
readonly version_TAG="${SCRIPT_VERSION}_${SCRIPT_VERSTAG}"

# Give higher priority to built-in binaries #
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH"

Expand All @@ -91,6 +83,17 @@ readonly LAN_IFname="$(nvram get lan_ifname)"
[ -z "$(nvram get odmpid)" ] && ROUTER_MODEL="$(nvram get productid)" || ROUTER_MODEL="$(nvram get odmpid)"
ROUTER_MODEL="$(echo "$ROUTER_MODEL" | tr 'a-z' 'A-Z')"

##-------------------------------------##
## Added by Martinski W. [2025-Mar-16] ##
##-------------------------------------##
readonly scriptVersRegExp="v[0-9]{1,2}([.][0-9]{1,2})([.][0-9]{1,2})"
readonly webPageFileRegExp="user([1-9]|[1-2][0-9])[.]asp"
readonly webPageLineTabExp="\{url: \"$webPageFileRegExp\", tabName: "
readonly webPageLineRegExp="${webPageLineTabExp}\"$SCRIPT_NAME\"\},"
readonly branchxStr_TAG="[Branch: $SCRIPT_BRANCH]"
readonly versionDev_TAG="${SCRIPT_VERSION}_${SCRIPT_VERSTAG}"
readonly versionMod_TAG="$SCRIPT_VERSION on $ROUTER_MODEL"

##-------------------------------------##
## Added by Martinski W. [2025-Mar-16] ##
##-------------------------------------##
Expand Down Expand Up @@ -2549,7 +2552,7 @@ Routing_NVRAM()
do
if [ "$(eval echo '$'"VPN_IP_LIST_ORIG_$COUNTER")" != "$(eval echo '$'"VPN_IP_LIST_NEW_$COUNTER")" ]
then
Print_Output true "VPN Client $COUNTER client list has changed, restarting VPN Client $COUNTER"
Print_Output true "VPN Client $COUNTER client list has changed, restarting VPN Client $COUNTER" "$PASS"

if [ "$(/bin/uname -m)" = "aarch64" ]
then
Expand Down Expand Up @@ -2677,7 +2680,7 @@ DHCP_Conf()
then
cp "$TMPCONF" "$DNSCONF"
service restart_dnsmasq >/dev/null 2>&1
Print_Output true "DHCP configuration updated"
Print_Output true "DHCP configuration updated" "$PASS"
sleep 2
fi

Expand Down Expand Up @@ -2711,7 +2714,7 @@ _NVRAM_Get_WAN_IFace_()
##----------------------------------------##
Config_Networks()
{
Print_Output true "$SCRIPT_NAME $SCRIPT_VERSION starting up"
Print_Output true "$SCRIPT_NAME $SCRIPT_VERSION starting up" "$PASS"
WIRELESSRESTART="false"
GUESTLANENABLED="false"

Expand Down Expand Up @@ -2770,7 +2773,7 @@ Config_Networks()
then
if [ "$(eval echo '$'"$(Get_Iface_Var "$IFACE")_REDIRECTALLTOVPN")" = "true" ]
then
Print_Output true "$IFACE (SSID: $(nvram get "${IFACE}_ssid")) - VPN redirection enabled, sending all interface internet traffic over VPN Client $VPNCLIENTNO"
Print_Output true "$IFACE (SSID: $(nvram get "${IFACE}_ssid")) - VPN redirection enabled, sending all interface internet traffic over VPN Client $VPNCLIENTNO" "$PASS"

if [ "$(_FWVersionStrToNum_ "$fwInstalledBranchVer")" -lt "$(_FWVersionStrToNum_ 3004.386.3)" ]
then
Expand All @@ -2781,7 +2784,7 @@ Config_Networks()

Firewall_NAT create "$IFACE" "$VPNCLIENTNO" 2>/dev/null
else
Print_Output true "$IFACE (SSID: $(nvram get "${IFACE}_ssid")) - sending all interface internet traffic over WAN interface"
Print_Output true "$IFACE (SSID: $(nvram get "${IFACE}_ssid")) - sending all interface internet traffic over WAN interface" "$PASS"

Firewall_NAT delete "$IFACE" 2>/dev/null

Expand All @@ -2807,7 +2810,7 @@ Config_Networks()

if [ "$(eval echo '$'"$(Get_Iface_Var "$IFACE")_ALLOWINTERNET")" = "false" ]
then
Print_Output true "$IFACE (SSID: $(nvram get "${IFACE}_ssid")) - allow internet disabled, blocking all interface internet traffic"
Print_Output true "$IFACE (SSID: $(nvram get "${IFACE}_ssid")) - allow internet disabled, blocking all interface internet traffic" "$WARN"
Firewall_BlockInternet create "$IFACE" 2>/dev/null
else
Firewall_BlockInternet delete "$IFACE" 2>/dev/null
Expand Down Expand Up @@ -2913,7 +2916,7 @@ Execute_UserScripts()
for shFile in $FILES
do
if [ -f "$shFile" ]; then
Print_Output true "Executing user script: $shFile"
Print_Output true "Executing user script: $shFile" "$PASS"
sh "$shFile"
fi
done
Expand Down Expand Up @@ -2991,58 +2994,90 @@ PressEnter()
return 0
}

##-------------------------------------##
## Added by Martinski W. [2025-Oct-26] ##
##-------------------------------------##
_CenterTextStr_()
{
if [ $# -lt 2 ] || [ -z "$1" ] || [ -z "$2" ] || \
! echo "$2" | grep -qE "^[1-9][0-9]+$"
then echo ; return 1
fi
local stringLen="${#1}"
local space1Len="$((($2 - stringLen)/2))"
local space2Len="$space1Len"
local totalLen="$((space1Len + stringLen + space2Len))"

if [ "$totalLen" -lt "$2" ]
then space2Len="$((space2Len + 1))"
elif [ "$totalLen" -gt "$2" ]
then space1Len="$((space1Len - 1))"
fi
if [ "$space1Len" -gt 0 ] && [ "$space2Len" -gt 0 ]
then printf "%*s%s%*s" "$space1Len" '' "$1" "$space2Len" ''
else printf "%s" "$1"
fi
}

##----------------------------------------##
## Modified by Martinski W. [2025-Oct-26] ##
##----------------------------------------##
ScriptHeader()
{
clear
printf "\n"
printf "${BOLD}###################################################${CLEARFORMAT}\\n"
printf "${BOLD}## ##${CLEARFORMAT}\\n"
printf "${BOLD}## __ __ ______ _ ##${CLEARFORMAT}\\n"
printf "${BOLD}## \ \ / / | ____|(_) ##${CLEARFORMAT}\\n"
printf "${BOLD}## \ \_/ /__ _ ____| |__ _ ##${CLEARFORMAT}\\n"
printf "${BOLD}## \ // _ ||_ /| __| | | ##${CLEARFORMAT}\\n"
printf "${BOLD}## | || (_| | / / | | | | ##${CLEARFORMAT}\\n"
printf "${BOLD}## |_| \__,_|/___||_| |_| ##${CLEARFORMAT}\\n"
printf "${BOLD}## ##${CLEARFORMAT}\\n"
printf "${BOLD}## %9s on %-18s ##${CLEARFORMAT}\n" "$SCRIPT_VERSION" "$ROUTER_MODEL"
printf "${BOLD}## ##${CLEARFORMAT}\\n"
printf "${BOLD}## https://github.com/AMTM-OSR/YazFi ##${CLEARFORMAT}\\n"
printf "${BOLD}## Forked from: https://github.com/jackyaz/YazFi ##${CLEARFORMAT}\\n"
printf "${BOLD}## ##${CLEARFORMAT}\\n"
printf "${BOLD}###################################################${CLEARFORMAT}\\n"
printf "\n"
local spaceLen=46 colorCT
[ "$SCRIPT_BRANCH" = "master" ] && colorCT="$GRNct" || colorCT="$MGNTct"
echo
printf "${BOLD}####################################################${CLRct}\n"
printf "${BOLD}## __ __ ______ _ ##${CLRct}\n"
printf "${BOLD}## \ \ / / | ____|(_) ##${CLRct}\n"
printf "${BOLD}## \ \_/ /__ _ ____| |__ _ ##${CLRct}\n"
printf "${BOLD}## \ // _ ||_ /| __| | | ##${CLRct}\n"
printf "${BOLD}## | || (_| | / / | | | | ##${CLRct}\n"
printf "${BOLD}## |_| \__,_|/___||_| |_| ##${CLRct}\n"
printf "${BOLD}## ##${CLRct}\n"
printf "${BOLD}## ${GRNct}%s${CLRct}${BOLD} ##${CLRct}\n" "$(_CenterTextStr_ "$versionMod_TAG" "$spaceLen")"
printf "${BOLD}## ${colorCT}%s${CLRct}${BOLD} ##${CLRct}\n" "$(_CenterTextStr_ "$branchxStr_TAG" "$spaceLen")"
printf "${BOLD}## ##${CLRct}\n"
printf "${BOLD}## https://github.com/AMTM-OSR/YazFi ##${CLRct}\n"
printf "${BOLD}## Forked from: https://github.com/jackyaz/YazFi ##${CLRct}\n"
printf "${BOLD}## ##${CLRct}\n"
printf "${BOLD}####################################################${CLRct}\n\n"
}

##----------------------------------------##
## Modified by Martinski W. [2025-Oct-26] ##
##----------------------------------------##
MainMenu()
{
printf "WebUI for %s is available at:\n${SETTING}%s${CLEARFORMAT}\n\n" "$SCRIPT_NAME" "$(Get_WebUI_URL)"
printf "WebUI for %s is available at:\n${SETTING}%s${CLRct}\n\n" "$SCRIPT_NAME" "$(Get_WebUI_URL)"

printf "1. Apply %s settings\n\n" "$SCRIPT_NAME"
printf "2. Show connected clients using %s\\n\\n" "$SCRIPT_NAME"
printf "3. Edit %s config\\n" "$SCRIPT_NAME"
printf "4. Edit Guest Network config (SSID + passphrase)\\n\\n"
printf "2. Show connected clients using %s\n\n" "$SCRIPT_NAME"
printf "3. Edit %s config\n" "$SCRIPT_NAME"
printf "4. Edit Guest Network config (SSID + passphrase)\n\n"
if [ -f /opt/bin/qrencode ]
then
printf "5. Show QR Code for Guest Network\n\n"
else
printf "\nQR Code generation NOT supported.\n\n"
fi
printf "u. Check for updates\\n"
printf "uf. Update %s with latest version (force update)\\n\\n" "$SCRIPT_NAME"
printf "d. Generate %s diagnostics\\n\\n" "$SCRIPT_NAME"
printf "e. Exit %s\\n\\n" "$SCRIPT_NAME"
printf "z. Uninstall %s\\n" "$SCRIPT_NAME"
printf "\\n"
printf "${BOLD}#############################################${CLEARFORMAT}\\n"
printf "\\n"
printf "u. Check for updates\n"
printf "uf. Update %s with latest version (force update)\n\n" "$SCRIPT_NAME"
printf "d. Generate %s diagnostics\n\n" "$SCRIPT_NAME"
printf "e. Exit %s\n\n" "$SCRIPT_NAME"
printf "z. Uninstall %s\n" "$SCRIPT_NAME"
printf "\n"
printf "${BOLD}#############################################${CLRct}\n"
printf "\n"

while true
do
printf "Choose an option: "
read -r menuOption
case "$menuOption" in
1)
printf "\\n"
printf "\n"
if Check_Lock menu; then
Config_Networks
Clear_Lock
Expand Down Expand Up @@ -3112,7 +3147,7 @@ MainMenu()
;;
e)
ScriptHeader
printf "\\n${BOLD}Thanks for using %s!${CLEARFORMAT}\\n\\n\\n" "$SCRIPT_NAME"
printf "\n${BOLD}Thanks for using %s!${CLEARFORMAT}\n\n\n" "$SCRIPT_NAME"
exit 0
;;
z)
Expand Down Expand Up @@ -3218,7 +3253,7 @@ Menu_Install()
then
Conf_Download "$SCRIPT_CONF"
else
Print_Output false "Existing $SCRIPT_CONF found. This will be kept by $SCRIPT_NAME"
Print_Output false "Existing $SCRIPT_CONF found. This will be kept by $SCRIPT_NAME" "$PASS"
Conf_Download "$SCRIPT_CONF.example"
fi

Expand Down Expand Up @@ -3264,6 +3299,7 @@ Menu_Startup()
Create_Dirs
Create_Symlinks
Auto_Cron create 2>/dev/null
Set_Version_Custom_Settings local "$SCRIPT_VERSION"
Mount_WebUI
}

Expand Down Expand Up @@ -3927,8 +3963,8 @@ EOF
modprobe xt_comment

if [ "$SCRIPT_BRANCH" = "master" ]
then SCRIPT_VERS_INFO="[$branchx_TAG]"
else SCRIPT_VERS_INFO="[$version_TAG, $branchx_TAG]"
then SCRIPT_VERS_INFO=""
else SCRIPT_VERS_INFO="[$versionDev_TAG]"
fi

##----------------------------------------##
Expand Down Expand Up @@ -3957,6 +3993,7 @@ then
Auto_ServiceEvent create 2>/dev/null
Auto_ServiceStart create 2>/dev/null
Auto_OpenVPNEvent create 2>/dev/null
Set_Version_Custom_Settings local "$SCRIPT_VERSION"
Shortcut_Script create
_CheckFor_WebGUI_Page_
ScriptHeader
Expand Down
19 changes: 11 additions & 8 deletions YazFi_www.asp
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,33 @@ p{font-weight:bolder}thead.collapsible-jquery{color:#fff;padding:0;width:100%;bo
<script language="JavaScript" type="text/javascript" src="/popup.js"></script>
<script language="JavaScript" type="text/javascript" src="/help.js"></script>
<script language="JavaScript" type="text/javascript" src="/ext/shared-jy/detect.js"></script>
<script language="JavaScript" type="text/javascript" src="/tmhist.js"></script>
<script language="JavaScript" type="text/javascript" src="/tmmenu.js"></script>
<script language="JavaScript" type="text/javascript" src="/client_function.js"></script>
<script language="JavaScript" type="text/javascript" src="/validator.js"></script>
<script language="JavaScript" type="text/javascript" src="/base64.js"></script>
<script>
/**----------------------------------------**/
/** Modified by Martinski W. [2024-Aug-19] **/
/** Modified by Martinski W. [2025-Oct-27] **/
/**----------------------------------------**/
var custom_settings;
function LoadCustomSettings(){
function LoadCustomSettings()
{
custom_settings = <% get_custom_settings(); %>;
for(var prop in custom_settings){
if (Object.prototype.hasOwnProperty.call(custom_settings,prop)){
if (prop.indexOf('yazfi') !== -1 && prop.indexOf('yazfi_version') === -1){
for (var prop in custom_settings)
{
if (Object.prototype.hasOwnProperty.call(custom_settings,prop))
{
if (prop.indexOf('yazfi') !== -1 && prop.indexOf('yazfi_version') === -1)
{
eval('delete custom_settings.'+prop);
}
}
}
}
function jy_checkIPConflict(CompareItem,sourceIP,sourceMask,compareIP,compareMask){
function jy_checkIPConflict(CompareItem,sourceIP,sourceMask,compareIP,compareMask)
{
var SetIPConflictAttr = function(){
this.state = false;
this.ipAddr = '';
Expand Down