add auto aware👀
All checks were successful
Update Dispatches / refresh-news (push) Successful in 3s

This commit is contained in:
2026-02-06 08:30:41 -05:00
parent 2e47a27ce2
commit 3968d477a0

View File

@@ -6,7 +6,7 @@
# --- Brighter 256-Color Palette ---
BLUE='\033[38;5;45m'; PURPLE='\033[38;5;127m'; GOLD='\033[38;5;178m'; RED='\033[38;5;196m'; NC='\033[0m'
# --- THE SOURCE OF TRUTH (Synced to 2.3.6) ---
# --- THE SOURCE OF TRUTH ---
VERSION="2.3.6"
REPO_RAW="https://git.dynastyrevolution.com/DYNR/DynastyRevolution-Scripts/raw/branch/main"
CURRENT_DATE=$(date +"%m-%d-%Y")
@@ -29,10 +29,18 @@ echo -e "${PURPLE}-------------------------------------------------${NC}"
# --- Version & Existing Install Detection ---
if [ -f "/usr/local/bin/dynr" ]; then
# Detect version from the existing binary
CURRENT_VER=$(grep -m 1 "VERSION=" /usr/local/bin/dynr | sed -E 's/.*VERSION="?([0-9.]+)"?.*/\1/')
[[ -z "$CURRENT_VER" ]] && CURRENT_VER="Unknown"
# --- NEW: Self-Update Check ---
REMOTE_VER=$(curl -sL "$REPO_RAW/install.sh" | grep -m 1 "VERSION=" | sed -E 's/.*VERSION="?([0-9.]+)"?.*/\1/')
if [[ "$REMOTE_VER" != "$CURRENT_VER" && "$REMOTE_VER" != "" ]]; then
echo -e "${RED}✨ A NEW ERA HAS DAWNED: v$REMOTE_VER IS AVAILABLE! (Current: v$CURRENT_VER)${NC}"
echo -e "${RED} Select option 2 below to manifest the latest scrolls.${NC}"
echo -e "${PURPLE}-------------------------------------------------${NC}"
fi
echo -e "${GOLD}⚠️ Dynasty Framework detected (v$CURRENT_VER)${NC}"
echo -e "Select your path:"
echo -e "1) ${BLUE}Quick Strike${NC} (Run or Manifest Modules)"
@@ -92,11 +100,17 @@ if [ -f "/usr/local/bin/dynr" ]; then
exit 0
;;
2)
echo -e "${BLUE}Proceeding with Update...${NC}"
# THE FIX: This actually overwrites the bin with the latest code
sudo curl -sSL "$REPO_RAW/install.sh" -o /usr/local/bin/dynr
sudo chmod +x /usr/local/bin/dynr
echo -e "${GOLD}✅ System Manifest Updated to v$VERSION${NC}"
echo -e "${BLUE}📡 Fetching scrolls of change...${NC}"
CHANGES=$(curl -sL "$REPO_RAW/dispatches.txt" | head -n 15)
if whiptail --title "Dynasty Update Manifest" --scrolltext --yesno "Reviewing latest changes:\n\n$CHANGES\n\nProceed with system manifest v$REMOTE_VER?" 20 70; then
echo -e "${BLUE}Proceeding with Update...${NC}"
sudo curl -sSL "$REPO_RAW/install.sh" -o /usr/local/bin/dynr
sudo chmod +x /usr/local/bin/dynr
echo -e "${GOLD}✅ System Manifest Updated to v$REMOTE_VER${NC}"
else
echo -e "${GOLD}🐉 Update deferred.${NC}"
fi
exit 0
;;
3)
@@ -111,5 +125,4 @@ if [ -f "/usr/local/bin/dynr" ]; then
esac
fi
# --- Final Initialization Message ---
echo -e "\n${BLUE}System Initialized. Version: $VERSION${NC}"