Initial commit

This commit is contained in:
Fr4nz D13trich 2025-12-20 14:43:53 +01:00
commit 7e8bc011c5
4 changed files with 262 additions and 0 deletions

150
helium_helper.sh Executable file
View file

@ -0,0 +1,150 @@
#!/bin/bash
# HELIUM BOWSER INSTALL & UPDATE SCRIPT ---> INTERACTIVE
## SOME COLOR
CYN="\e[0;36m"
YEL="\e[0;33m"
RED="\e[0;31m"
GRN="\e[0;32m"
CRS="\e[0m"
## FOLDER & GLOBAL VARIABLES
SCRIPT_VERSION="0.4"
mkdir -p /tmp/Helium
TMP=/tmp/Helium
INSTALL_PATH=$HOME/.apps/Helium
PROFILE=$HOME/.profile
MISSING=$(cat $TMP/missingDeps 2>/dev/null)
DEPENDENCIES=("curl" "wget")
GIT_VERSION=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "tag_name" | tr -d \", | awk '{print $2}')
### SCRIPT DEPENDENCIES
dependency_check() {
local PACKAGE="$1"
if command -v "$PACKAGE" >/dev/null 2>&1 ; then
:
else
echo "$PACKAGE" >> $TMP/missingDeps
fi
}
for PACKAGE in "${DEPENDENCIES[@]}" ; do
dependency_check "$PACKAGE"
done
if ! [ "$MISSING" ] ; then
:
else
echo -e "\n ${RED}Following dependencies are missing :\n\n${YEL}$MISSING\n\n ${CYN}Please install and re-run script !${CRS}"
rm $TMP/missingDeps
exit 1
fi
## CHECK LOCAL INSTALL
install_helium() {
while true ; do
read -p " Download and install Helium from GitHub? (Y/n) : " CONFIRM_INSTALL
if [[ "$CONFIRM_INSTALL" == "" || "$CONFIRM_INSTALL" == "y" || "$CONFIRM_INSTALL" == "Y" ]] ; then
GIT_URL=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}')
GIT_FILENAME=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}' | awk -F'/' '{print $9}')
wget -P $TMP $GIT_URL -q --show-progress
chmod +x $TMP/$GIT_FILENAME
mkdir -p $INSTALL_PATH
mv $TMP/$GIT_FILENAME $INSTALL_PATH/helium-browser.AppImage
echo -e "\n ${GRN}Helium is installed !${CRS}\n"
rm -rf $TMP
exit 0
elif [[ "$CONFIRM_INSTALL" == "n" || "$CONFIRM_INSTALL" == "N" ]] ; then
echo -e "\n ${RED}Installation cancelled !${CRS}\n"
exit 1
else
echo -e " ${YEL}Invalid response !${CRS}\n"
fi
done
}
if ! [ -d "$INSTALL_PATH" ] ; then
echo -e "\n ${RED}Helium directory not found !${CRS}"
install_helium
elif ! [ -f "$INSTALL_PATH/helium-browser.AppImage" ] ; then
echo -e "\n ${RED}Helium directory found but no executable named ${CYN}helium-browser.AppImage ${RED}!${CRS}"
install_helium
else
:
fi
## COMPARE
update_helium() {
while true ; do
read -p " Download and update Helium from GitHub? (Y/n) : " CONFIRM
if [[ "$CONFIRM" == "" || "$CONFIRM" == "y" || "$CONFIRM" == "Y" ]] ; then
GIT_URL=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}')
GIT_FILENAME=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}' | awk -F'/' '{print $9}')
wget -P $TMP $GIT_URL -q --show-progress
chmod +x $TMP/$GIT_FILENAME
rm $INSTALL_PATH/helium-browser.OldAppImage >/dev/null 2>&1
mv $INSTALL_PATH/helium-browser.AppImage $INSTALL_PATH/helium-browser.OldAppImage >/dev/null 2>&1
mv $TMP/$GIT_FILENAME $INSTALL_PATH/helium-browser.AppImage
echo -e "\n ${GRN}Helium is up-to-date !${CRS}\n"
break
elif [[ "$CONFIRM" == "n" || "$CONFIRM" == "N" ]] ; then
echo -e "\n ${RED}Update cancelled !${CRS}\n"
exit 1
else
echo -e " ${YEL}Invalid response !${CRS}\n"
fi
done
}
LOCAL_VERSION=$($INSTALL_PATH/helium-browser.AppImage --version | awk '{print $2}')
### CHECK FROM EMPTY VERSION TAGS
if [ -z "$GIT_VERSION" ] ; then
echo -e "\n ${RED}Empty version tag from ${CYN}GitHub ${RED}! Can't compare, exiting ...${CRS}"
exit 1
elif [ -z "$LOCAL_VERSION" ] ; then
echo -e "\n ${RED}Empty version tag from ${CYN}local AppImage ${RED}! Can't compare, exiting ...${CRS}"
exit 1
else
:
fi
if [ "$GIT_VERSION" == "$LOCAL_VERSION" ] ; then
echo -e "\n ${GRN}Helium is up-to-date !${CRS}\n"
else
echo -e "\n ${RED}Helium is updatable !${CRS}\n"
echo -e " ${CYN}Local Version : ${CRS}${LOCAL_VERSION}"
echo -e " ${CYN}GitHub Version : ${CRS}${GIT_VERSION}\n"
update_helium
fi
rm -rf $TMP
exit 0