Skip to content

Update ezp.sh to use APK for Alpine #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
83 changes: 33 additions & 50 deletions ezp.sh
Original file line number Diff line number Diff line change
@@ -1,29 +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/openwrt_release
sed -i 's/DISTRIB_DESCRIPTION=.*/DISTRIB_DESCRIPTION="PeDitX OS telegram:@peditx"/' /etc/openwrt_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

Expand All @@ -40,85 +41,69 @@ echo -e "${MAGENTA}
E Z P A S S W A L L v2 ${NC}"
sleep 3

# First Reform
opkg update
opkg install curl luci-compat
opkg install luci-lib-ipkg
# Install dependencies using apk
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
# 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"
# 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 .ipk file of $THEME_NAME not found."
return 1
fi

# Download the .ipk package
echo "Downloading the latest version of $THEME_NAME..."
wget -q $IPK_URL -O /tmp/$THEME_NAME.ipk

# Install the .ipk package
echo "Installing $THEME_NAME..."
opkg install /tmp/$THEME_NAME.ipk

# Clean up the downloaded file
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 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"

# Install luci-theme-carbonpx
install_theme "luci-theme-carbonpx" "luci-theme-carbonpx"

opkg remove luci-theme-bootstrap --force-depends
# Restart the web service to apply the changes
echo "Restarting uhttpd service to apply changes..."
apk del luci-theme-bootstrap --force
/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}"
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

clear

##Scanning

. /etc/openwrt_release
# Scanning System Info
. /etc/os-release

echo -e "${MAGENTA}
______ _____ _ _ _ _____
Expand All @@ -131,10 +116,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