add remove modules option
All checks were successful
Update Dispatches / refresh-news (push) Successful in 1s
All checks were successful
Update Dispatches / refresh-news (push) Successful in 1s
This commit is contained in:
40
install.sh
40
install.sh
@@ -28,7 +28,6 @@ echo -e "${PURPLE}-------------------------------------------------${NC}"
|
||||
# --- 4. NEWS DISPATCH ---
|
||||
echo -e "${GOLD}📜 LATEST ARCHIVE DISPATCHES:${NC}"
|
||||
NEWS_DATA=$(curl -sL -A "Mozilla/5.0" "$REPO_RAW/dispatches.txt")
|
||||
|
||||
if [[ -z "$NEWS_DATA" || "$NEWS_DATA" == *"404"* ]]; then
|
||||
echo -e " ${RED}The Archives are currently silent.${NC}"
|
||||
else
|
||||
@@ -40,11 +39,9 @@ echo -e "${PURPLE}-------------------------------------------------${NC}"
|
||||
if [ ! -f "/usr/local/bin/dynr" ]; then
|
||||
echo -e "${GOLD}⚠️ Dynasty Framework is not yet manifested on this $OS_TYPE system.${NC}"
|
||||
read -p "📥 Initiate First Strike (Install)? (y/n): " INSTALL_CONFIRM < /dev/tty
|
||||
|
||||
if [[ "$INSTALL_CONFIRM" == "y" || "$INSTALL_CONFIRM" == "Y" ]]; then
|
||||
echo -e "${BLUE}📡 Manifesting core files in $DYNR_PATH...${NC}"
|
||||
[[ "$OS_TYPE" == "macOS" ]] && mkdir -p "$DYNR_PATH/modules" || sudo mkdir -p "$DYNR_PATH/modules"
|
||||
|
||||
sudo curl -sSL "$REPO_RAW/install.sh" -o /usr/local/bin/dynr
|
||||
sudo chmod +x /usr/local/bin/dynr
|
||||
echo -e "${GOLD}✅ System Manifested! Type 'dynr' to begin.${NC}"
|
||||
@@ -68,22 +65,20 @@ if [ -f "/usr/local/bin/dynr" ]; then
|
||||
|
||||
echo -e "${GOLD}⚠️ Dynasty Framework (v$CURRENT_VER)${NC}"
|
||||
echo -e "1) ${BLUE}Quick Strike${NC} (Modules)"
|
||||
echo -e "2) ${BLUE}Update${NC}"
|
||||
echo -e "3) ${RED}Uninstall${NC}"
|
||||
echo "4) Exit"
|
||||
echo -e "2) ${BLUE}Update Framework${NC}"
|
||||
echo -e "3) ${RED}Uninstall Framework${NC}"
|
||||
echo -e "4) ${PURPLE}Remove Modules${NC}"
|
||||
echo "5) Exit"
|
||||
echo ""
|
||||
read -p "Selection: " OPT < /dev/tty
|
||||
read -p "Selection [1-5]: " OPT < /dev/tty
|
||||
|
||||
case $OPT in
|
||||
1)
|
||||
# --- Local Modules ---
|
||||
echo -e "\n${PURPLE}📜 Local Scrolls ($DYNR_PATH):${NC}"
|
||||
ls "$DYNR_PATH/modules" 2>/dev/null | sed 's/^/ ↓ /' || echo " (Empty)"
|
||||
|
||||
# --- Cloud Manifest (Restored Logic) ---
|
||||
echo -e "\n${BLUE}☁️ Cloud Manifest (Available):${NC}"
|
||||
CLOUD_DATA=$(curl -sL -A "Mozilla/5.0" "$REPO_RAW/modules_list.txt" | grep -v "Not found")
|
||||
|
||||
if [[ -z "$CLOUD_DATA" ]]; then
|
||||
echo -e " ${GOLD}Scanning the heavens... (No remote modules found)${NC}"
|
||||
else
|
||||
@@ -96,13 +91,8 @@ if [ -f "/usr/local/bin/dynr" ]; then
|
||||
if [[ -n "$CMD_INPUT" && "$CMD_INPUT" != "exit" ]]; then
|
||||
if [ ! -f "$DYNR_PATH/modules/$CMD_INPUT" ]; then
|
||||
echo -e "${GOLD}🔎 Fetching module from cloud...${NC}"
|
||||
if [[ "$OS_TYPE" == "macOS" ]]; then
|
||||
curl -s -o "$DYNR_PATH/modules/$CMD_INPUT" "$REPO_RAW/modules/$CMD_INPUT"
|
||||
chmod +x "$DYNR_PATH/modules/$CMD_INPUT"
|
||||
else
|
||||
sudo curl -s -o "$DYNR_PATH/modules/$CMD_INPUT" "$REPO_RAW/modules/$CMD_INPUT"
|
||||
sudo chmod +x "$DYNR_PATH/modules/$CMD_INPUT"
|
||||
fi
|
||||
curl -s -o "$DYNR_PATH/modules/$CMD_INPUT" "$REPO_RAW/modules/$CMD_INPUT"
|
||||
chmod +x "$DYNR_PATH/modules/$CMD_INPUT"
|
||||
fi
|
||||
"$DYNR_PATH/modules/$CMD_INPUT" </dev/tty
|
||||
fi
|
||||
@@ -115,11 +105,21 @@ if [ -f "/usr/local/bin/dynr" ]; then
|
||||
3)
|
||||
sudo rm -f /usr/local/bin/dynr
|
||||
rm -rf "$DYNR_PATH"
|
||||
echo -e "${RED}System purged.${NC}"
|
||||
echo -e "${RED}Framework purged.${NC}"
|
||||
;;
|
||||
4)
|
||||
echo -e "\n${RED}🗑️ MODULE PURGE PROTOCOL${NC}"
|
||||
ls "$DYNR_PATH/modules" 2>/dev/null | sed 's/^/ ❌ /' || echo " (Nothing to remove)"
|
||||
read -p "Enter module name to delete (or 'cancel'): " RM_INPUT < /dev/tty
|
||||
if [[ -n "$RM_INPUT" && "$RM_INPUT" != "cancel" ]]; then
|
||||
rm -f "$DYNR_PATH/modules/$RM_INPUT"
|
||||
echo -e "${GOLD}✅ Module '$RM_INPUT' removed.${NC}"
|
||||
fi
|
||||
;;
|
||||
5)
|
||||
echo "Exiting..."; exit 0 ;;
|
||||
*)
|
||||
echo "Exiting..."
|
||||
;;
|
||||
echo "Invalid selection." ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user