From addafd8967cabc29f3f8e7f6d270324ec7db827a Mon Sep 17 00:00:00 2001 From: Mohammad Hossein Kalantarian Date: Sat, 8 Feb 2025 10:06:36 -0800 Subject: [PATCH 1/3] Update ezp.sh to use APK for Alpine --- ezp.sh | 46 ++++++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/ezp.sh b/ezp.sh index 811c6ee..547bb43 100644 --- a/ezp.sh +++ b/ezp.sh @@ -13,17 +13,15 @@ sleep 2 clear uci set system.@system[0].zonename='Asia/Tehran' - uci set system.@system[0].timezone='<+0330>-3:30' - uci commit uci set system.@system[0].hostname='PeDitXOS' uci commit system /etc/init.d/system restart -sed -i 's/DISTRIB_ID=.*/DISTRIB_ID="PeDitXOS"/' /etc/openwrt_release -sed -i 's/DISTRIB_DESCRIPTION=.*/DISTRIB_DESCRIPTION="PeDitX OS telegram:@peditx"/' /etc/openwrt_release +sed -i 's/DISTRIB_ID=.*/DISTRIB_ID="PeDitXOS"/' /etc/os-release +sed -i 's/DISTRIB_DESCRIPTION=.*/DISTRIB_DESCRIPTION="PeDitX OS telegram:@peditx"/' /etc/os-release /sbin/reload_config @@ -41,16 +39,16 @@ echo -e "${MAGENTA} sleep 3 # First Reform -opkg update -opkg install curl luci-compat -opkg install luci-lib-ipkg +apk update +apk add curl luci-compat +apk add luci-lib-ipkg sleep 2 clear -opkg install luci-app-ttyd +apk add luci-app-ttyd sleep 2 -opkg remove uci-mod-dashboard +apk del uci-mod-dashboard sleep 2 -opkg install whiptail +apk add whiptail sleep 2 # Function to install a theme @@ -62,24 +60,24 @@ install_theme() { # GitHub repository URL and package name LATEST_RELEASE_URL="https://api.github.com/repos/peditx/$REPO_NAME/releases/latest" - IPK_URL=$(curl -s $LATEST_RELEASE_URL | grep "browser_download_url.*ipk" | cut -d '"' -f 4) + IPK_URL=$(curl -s $LATEST_RELEASE_URL | grep "browser_download_url.*apk" | cut -d '"' -f 4) # Check if the download link is found if [ -z "$IPK_URL" ]; then - echo "Download link for the .ipk file of $THEME_NAME not found." + echo "Download link for the .apk file of $THEME_NAME not found." return 1 fi - # Download the .ipk package + # Download the .apk package echo "Downloading the latest version of $THEME_NAME..." - wget -q $IPK_URL -O /tmp/$THEME_NAME.ipk + wget -q $IPK_URL -O /tmp/$THEME_NAME.apk - # Install the .ipk package + # Install the .apk package echo "Installing $THEME_NAME..." - opkg install /tmp/$THEME_NAME.ipk + apk add --allow-untrusted /tmp/$THEME_NAME.apk # Clean up the downloaded file - rm /tmp/$THEME_NAME.ipk + rm /tmp/$THEME_NAME.apk echo "$THEME_NAME installed successfully." } @@ -90,7 +88,7 @@ install_theme "luci-theme-peditx" "luci-theme-peditx" # Install luci-theme-carbonpx install_theme "luci-theme-carbonpx" "luci-theme-carbonpx" -opkg remove luci-theme-bootstrap --force-depends +apk del luci-theme-bootstrap --force # Restart the web service to apply the changes echo "Restarting uhttpd service to apply changes..." /etc/init.d/uhttpd restart @@ -99,17 +97,15 @@ clear ### install themeswitch - echo -e "${GREEN}New theme Installed ✅ OK${NC}" sleep 2 echo -e "${GREEN}Android mobile app service Installed ✅ OK${NC}" sleep 2 -echo -e "${GREEN}Ios native Web application Installed ✅ OK${NC}" +echo -e "${GREEN}iOS native Web application Installed ✅ OK${NC}" sleep 2 echo -e "${GREEN}New version of PeDitX theme Installed ✅ OK${NC}" sleep 5 - clear rm -f setup.sh && wget https://raw.githubusercontent.com/peditx/iranIPS/refs/heads/main/.files/core/setup.sh && chmod 777 setup.sh @@ -118,7 +114,7 @@ clear ##Scanning -. /etc/openwrt_release +. /etc/os-release echo -e "${MAGENTA} ______ _____ _ _ _ _____ @@ -131,10 +127,8 @@ echo -e "${MAGENTA} E Z P A S S W A L L v2 ${NC}" EPOL=`cat /tmp/sysinfo/model` echo " - Model : $EPOL" -echo " - System Ver : $DISTRIB_RELEASE" -echo " - System Arch : $DISTRIB_ARCH" +echo " - System Ver : $VERSION_ID" +echo " - System Arch : $ARCH" -# RESULT=`echo "$DISTRIB_RELEASE" | grep -o 23 | sed -n '1p'` sleep 5 -# if [ "$RESULT" == "23" ]; then sh setup.sh From 3768b07657a557ad98040c060657ecfa7849121d Mon Sep 17 00:00:00 2001 From: Mohammad Hossein Kalantarian Date: Sat, 8 Feb 2025 10:15:02 -0800 Subject: [PATCH 2/3] Personalize ezp.sh --- ezp.sh | 66 +++++++++++++++++++++++++--------------------------------- 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/ezp.sh b/ezp.sh index 547bb43..e62846c 100644 --- a/ezp.sh +++ b/ezp.sh @@ -1,27 +1,30 @@ -#!/bin/bash +#!/bin/sh + +# Define color codes RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' MAGENTA='\033[0;35m' CYAN='\033[0;36m' -GRAY='\033[0;37m' NC='\033[0m' # No Color echo "Running as root..." sleep 2 clear +# Set system settings uci set system.@system[0].zonename='Asia/Tehran' uci set system.@system[0].timezone='<+0330>-3:30' uci commit -uci set system.@system[0].hostname='PeDitXOS' +uci set system.@system[0].hostname='MHKWRT' uci commit system /etc/init.d/system restart -sed -i 's/DISTRIB_ID=.*/DISTRIB_ID="PeDitXOS"/' /etc/os-release -sed -i 's/DISTRIB_DESCRIPTION=.*/DISTRIB_DESCRIPTION="PeDitX OS telegram:@peditx"/' /etc/os-release +# Update OpenWrt distribution info +sed -i 's/DISTRIB_ID=.*/DISTRIB_ID="MHKWRT"/' /etc/os-release +sed -i 's/DISTRIB_DESCRIPTION=.*/DISTRIB_DESCRIPTION="MHKWRT"/' /etc/os-release /sbin/reload_config @@ -38,7 +41,7 @@ echo -e "${MAGENTA} E Z P A S S W A L L v2 ${NC}" sleep 3 -# First Reform +# Install dependencies using apk apk update apk add curl luci-compat apk add luci-lib-ipkg @@ -51,69 +54,56 @@ sleep 2 apk add whiptail sleep 2 -# Function to install a theme +# Function to install themes from original GitHub repositories install_theme() { - local REPO_NAME=$1 - local THEME_NAME=$2 + local REPO_OWNER=$1 + local REPO_NAME=$2 + local THEME_NAME=$3 echo "Processing $THEME_NAME..." - # GitHub repository URL and package name - LATEST_RELEASE_URL="https://api.github.com/repos/peditx/$REPO_NAME/releases/latest" - IPK_URL=$(curl -s $LATEST_RELEASE_URL | grep "browser_download_url.*apk" | cut -d '"' -f 4) + # Get the latest release + LATEST_RELEASE_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases/latest" + IPK_URL=$(curl -s $LATEST_RELEASE_URL | grep "browser_download_url.*ipk" | cut -d '"' -f 4) - # Check if the download link is found if [ -z "$IPK_URL" ]; then - echo "Download link for the .apk file of $THEME_NAME not found." + echo "Download link for the .ipk file of $THEME_NAME not found." return 1 fi - # Download the .apk package - echo "Downloading the latest version of $THEME_NAME..." - wget -q $IPK_URL -O /tmp/$THEME_NAME.apk - - # Install the .apk package - echo "Installing $THEME_NAME..." - apk add --allow-untrusted /tmp/$THEME_NAME.apk - - # Clean up the downloaded file - rm /tmp/$THEME_NAME.apk - + wget -q $IPK_URL -O /tmp/$THEME_NAME.ipk + apk add --allow-untrusted /tmp/$THEME_NAME.ipk + rm /tmp/$THEME_NAME.ipk echo "$THEME_NAME installed successfully." } -# Install luci-theme-peditx -install_theme "luci-theme-peditx" "luci-theme-peditx" - -# Install luci-theme-carbonpx -install_theme "luci-theme-carbonpx" "luci-theme-carbonpx" +# Install themes from original repositories +install_theme "jerrykuku" "luci-theme-argon" "luci-theme-argon" +install_theme "openwrt-develop" "luci-theme-bootstrap-mod" "luci-theme-bootstrap-mod" apk del luci-theme-bootstrap --force -# Restart the web service to apply the changes -echo "Restarting uhttpd service to apply changes..." /etc/init.d/uhttpd restart clear -### install themeswitch - +# Messages echo -e "${GREEN}New theme Installed ✅ OK${NC}" sleep 2 echo -e "${GREEN}Android mobile app service Installed ✅ OK${NC}" sleep 2 echo -e "${GREEN}iOS native Web application Installed ✅ OK${NC}" sleep 2 -echo -e "${GREEN}New version of PeDitX theme Installed ✅ OK${NC}" +echo -e "${GREEN}New version of MHKWRT theme Installed ✅ OK${NC}" sleep 5 clear -rm -f setup.sh && wget https://raw.githubusercontent.com/peditx/iranIPS/refs/heads/main/.files/core/setup.sh && chmod 777 setup.sh +# Fetch the latest setup script from your GitHub repo +rm -f setup.sh && wget https://raw.githubusercontent.com/MHKalantarian/EZpasswall/main/.files/core/setup.sh && chmod 777 setup.sh clear -##Scanning - +# Scanning System Info . /etc/os-release echo -e "${MAGENTA} From ddf7582d3c3d5522270cdd586a04e44563549fae Mon Sep 17 00:00:00 2001 From: Mohammad Hossein Kalantarian Date: Sat, 8 Feb 2025 10:21:11 -0800 Subject: [PATCH 3/3] Update ezp.sh --- ezp.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ezp.sh b/ezp.sh index e62846c..dd03d4e 100644 --- a/ezp.sh +++ b/ezp.sh @@ -98,8 +98,7 @@ sleep 5 clear -# Fetch the latest setup script from your GitHub repo -rm -f setup.sh && wget https://raw.githubusercontent.com/MHKalantarian/EZpasswall/main/.files/core/setup.sh && chmod 777 setup.sh +rm -f setup.sh && wget https://raw.githubusercontent.com/peditx/iranIPS/refs/heads/main/.files/core/setup.sh && chmod 777 setup.sh clear