Add script to simplify install and uninstall for casaos edge store

This commit is contained in:
Christopher
2023-10-26 11:18:28 -05:00
parent 5e0d616ad0
commit 7e7dbca576
2 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# About
This script is designed to simplify the installation of the CasaOS AppStore Edge. If the CasaOS AppStore Edge is not currently installed, the script will proceed with the installation. If the CasaOS AppStore Edge is already installed, the script will prompt the user to confirm whether they wish to revert to the official app store.
[CasaOS AppStore Edge](https://github.com/WisdomSky/CasaOS-AppStore-Edge)
# Run command
```bash
bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/casaos-appstore-edge/run.sh)"
```

View File

@@ -0,0 +1,49 @@
#!/bin/bash
# Function to install Edge Appstore
install_edge_appstore() {
# Unregister the Official CasaOS Appstore
echo "Unregistering CasaOS Edge Appstore..."
casaos-cli app-management unregister app-store 0
# Register the Edge Appstore
echo "Installing CasaOS Edge Appstore..."
casaos-cli app-management register app-store https://casaos-appstore.paodayag.dev/edge.zip
echo "CasaOS Edge Appstore installed."
}
# Function to revert to the Official Appstore
revert_to_official_appstore() {
edge_appstore_id=$(casaos-cli app-management list app-stores | grep -i "edge" | awk '{print $1}')
if [ -z "$edge_appstore_id" ]; then
echo "Error: Could not find CasaOS Edge Appstore ID."
exit 1
fi
echo "Unregistering CasaOS Edge Appstore with ID: $edge_appstore_id..."
casaos-cli app-management unregister app-store "$edge_appstore_id"
echo "Registering the Official CasaOS Appstore..."
casaos-cli app-management register app-store https://github.com/IceWhaleTech/CasaOS-AppStore/archive/refs/heads/main.zip
echo "Switched back to the Official CasaOS Appstore."
}
# Check if Edge Appstore is already installed
is_edge_installed=$(casaos-cli app-management list app-stores | grep -i "edge")
if [ -z "$is_edge_installed" ]; then
# Edge Appstore is not installed
install_edge_appstore
else
# Edge Appstore is already installed
echo "CasaOS Edge Appstore is already installed."
read -p "Do you want to revert to the Official CasaOS Appstore? (y/n): " choice
case "$choice" in
y|Y ) revert_to_official_appstore ;;
n|N ) echo "Keeping the Edge Appstore." ;;
* ) echo "Invalid choice. Exiting." ;;
esac
fi
echo "Done."