|
| 1 | +#!/bin/bash |
| 2 | +###########- COLOR CODE -############## |
| 3 | +colornow=$(cat /etc/rmbl/theme/color.conf) |
| 4 | +NC="\e[0m" |
| 5 | +RED="\033[0;31m" |
| 6 | +COLOR1="$(cat /etc/rmbl/theme/$colornow | grep -w "TEXT" | cut -d: -f2|sed 's/ //g')" |
| 7 | +COLBG1="$(cat /etc/rmbl/theme/$colornow | grep -w "BG" | cut -d: -f2|sed 's/ //g')" |
| 8 | +WH='\033[1;37m' |
| 9 | +###########- END COLOR CODE -########## |
| 10 | + |
| 11 | +echo -e "$COLOR1┌─────────────────────────────────────────────────┐${NC}" |
| 12 | +echo -e "$COLOR1│${NC} ${WH} UPDATE SCRIPT BY CALIPHDEV ${NC} $COLOR1│${NC}" |
| 13 | +echo -e "$COLOR1└─────────────────────────────────────────────────┘${NC}" |
| 14 | +echo -e "" |
| 15 | +echo -e " \033[1;91m Update Script...\033[1;37m" |
| 16 | + |
| 17 | +# Define base URL |
| 18 | +BASE_URL="https://autoscript.caliphdev.com" |
| 19 | + |
| 20 | +# Function to download and install a file |
| 21 | +update_file() { |
| 22 | + local file_path=$1 |
| 23 | + local file_url=$2 |
| 24 | + local tmp_file="/tmp/$(basename "$file_path")" |
| 25 | + |
| 26 | + echo -e " Downloading $(basename "$file_path")..." |
| 27 | + if wget -q -O "$tmp_file" "$file_url"; then |
| 28 | + mv "$tmp_file" "$file_path" |
| 29 | + chmod +x "$file_path" |
| 30 | + echo -e " [${WH}OK${NC}] Updated $file_path" |
| 31 | + else |
| 32 | + echo -e " [${RED}FAIL${NC}] Failed to download $file_path" |
| 33 | + fi |
| 34 | +} |
| 35 | + |
| 36 | +# Update files |
| 37 | +update_file "/usr/bin/menu" "$BASE_URL/menu/menu.sh" |
| 38 | +update_file "/usr/bin/m-sshovpn" "$BASE_URL/menu/m-sshovpn.sh" |
| 39 | +update_file "/usr/bin/m-vmess" "$BASE_URL/menu/m-vmess.sh" |
| 40 | +update_file "/usr/bin/m-vless" "$BASE_URL/menu/m-vless.sh" |
| 41 | +update_file "/usr/bin/m-trojan" "$BASE_URL/menu/m-trojan.sh" |
| 42 | +update_file "/usr/bin/m-system" "$BASE_URL/menu/m-system.sh" |
| 43 | +update_file "/usr/bin/m-ssws" "$BASE_URL/menu/m-ssws.sh" |
| 44 | +update_file "/usr/bin/m-webmin" "$BASE_URL/menu/m-webmin.sh" |
| 45 | +update_file "/usr/bin/running" "$BASE_URL/menu/running.sh" |
| 46 | +update_file "/usr/bin/bw" "$BASE_URL/menu/bw.sh" |
| 47 | +update_file "/usr/bin/m-tcp" "$BASE_URL/menu/tcp.sh" |
| 48 | +update_file "/usr/bin/auto-reboot" "$BASE_URL/menu/auto-reboot.sh" |
| 49 | +update_file "/usr/bin/clearcache" "$BASE_URL/menu/clearcache.sh" |
| 50 | +update_file "/usr/bin/restart" "$BASE_URL/menu/restart.sh" |
| 51 | +update_file "/usr/bin/m-domain" "$BASE_URL/menu/m-domain.sh" |
| 52 | +update_file "/usr/bin/m-dns" "$BASE_URL/menu/m-dns.sh" |
| 53 | +update_file "/usr/bin/m-l2tp" "$BASE_URL/menu/m-l2tp.sh" |
| 54 | +update_file "/usr/bin/m-pptp" "$BASE_URL/menu/m-pptp.sh" |
| 55 | +update_file "/usr/bin/m-sstp" "$BASE_URL/menu/m-sstp.sh" |
| 56 | +update_file "/usr/bin/m-update" "$BASE_URL/update/update.sh" |
| 57 | + |
| 58 | +# Update version file |
| 59 | +echo -e " Updating Version..." |
| 60 | +serverV=$(curl -sS "$BASE_URL/menu/versi") |
| 61 | +if [ -n "$serverV" ]; then |
| 62 | + echo "$serverV" > /opt/.ver |
| 63 | + echo -e " [${WH}OK${NC}] Version updated to $serverV" |
| 64 | +else |
| 65 | + echo -e " [${RED}FAIL${NC}] Failed to fetch version" |
| 66 | +fi |
| 67 | + |
| 68 | +echo -e "" |
| 69 | +echo -e " \033[1;91m Update Done...\033[1;37m" |
| 70 | +sleep 2 |
| 71 | +menu |
0 commit comments