Initial commit

This commit is contained in:
Fr4nz D13trich 2025-12-20 14:53:27 +01:00
parent 96aa9870b5
commit 1ea3c4c1a3
5 changed files with 314 additions and 2 deletions

View file

@ -1,3 +1,18 @@
# helium-helper # Helium Bowser installer & updater
## Overview
### Helium_Helper.sh
- Interactive installer and updater script
- Installs to `/home/<USER>/.apps/Helium` | changeable in line 15 `INSTALL_PATH`
- Assumes:
- Presence of `/home/<USER>/.apps/Helium` when updating | changeable in line 15 `INSTALL_PATH`
- Executable named `helium-browser.AppImage` | for convenience so launchers don't have to be edited at each update
- Keeps prior AppImage as `helium-browser.OldAppImage` which will be replaced at every update
Install & Update Helium Browser on Linux ### Helium_Auto_Update.sh
- Automatic updater script for e.g. `cron`
- Installs to `/home/<USER>/.apps/Helium` | changeable in line 8 `INSTALL_PATH`
- Assumes:
- Presence of `/home/<USER>/.apps/Helium` when updating | changeable in line 8 `INSTALL_PATH`
- Executable named `helium-browser.AppImage` | for convenience so launchers don't have to be edited at each update
- Loggs to `/home/<USER>/.apps/Helium/updateLog`
- Keeps prior AppImage as `helium-browser.OldAppImage` which will be replaced at every update

94
helium_auto_update.sh Executable file
View file

@ -0,0 +1,94 @@
#!/bin/bash
# HELIUM BOWSER AUTO UPDATE SCRIPT WITH LOGGING
## VARIABLES & TMP FOLDER
mkdir -p /tmp/Helium
TMP=/tmp/Helium
INSTALL_PATH=$HOME/.apps/Helium
LOG=$INSTALL_PATH/updateLog
DEPENDENCIES=("curl" "wget")
MISSING=$(cat $TMP/missingDeps 2>/dev/null)
GIT_VERSION=$(curl -s https://api.github.com/repos/imputnet/helium-linux/releases/latest | grep "tag_name" | tr -d \", | awk '{print $2}')
LOCAL_VERSION=$($INSTALL_PATH/helium-browser.AppImage --version | awk '{print $2}')
DATE=$(date)
## CHECKS
if ! [ -d "$INSTALL_PATH" ] ; then
mkdir -p $INSTALL_PATH
echo "${DATE} | Failed to update - Helium installation path not present - But created for logging" >> $LOG
exit 1
elif ! [ -f "$INSTALL_PATH/helium-browser.AppImage" ] ; then
echo "${DATE} | Failed to update - Local Helium AppImage not found" >> $LOG
exit 1
else
:
fi
### 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 "${DATE} | Failed to update - missing dependencies : $MISSING" >> $LOG
exit 1
fi
## COMPARE VERSIONS
update_helium() {
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
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 "${DATE} | Helium updated to ${GIT_VERSION}" >> $LOG
}
### CHECK FOR EMPTY VERSION TAGS
if [[ -z "$GIT_VERSION" ]] ; then
echo "${DATE} | Failed to update - Emty version tag --> GIT" >> $LOG
exit 1
elif [[ -z "$LOCAL_VERSION" ]] ; then
echo "${DATE} | Failed to update - Emty version tag --> LOCAL" >> $LOG
exit 1
else
:
fi
if [[ "$GIT_VERSION" == "$LOCAL_VERSION" ]] ; then
:
else
update_helium
fi
rm -rf $TMP
exit 0

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

BIN
icon/helium-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 KiB

53
todo.md Normal file
View file

@ -0,0 +1,53 @@
# To Do List Helium installer
## Fix
- Auto Update implementation
## Add
- Internet connectivity check in [Auto Update Script](https://lab.c95.org/fr4nz/shell-scripts/src/branch/main/helium-browser/helium_auto_update.sh)
- Desktop entry [Helper Script](https://lab.c95.org/fr4nz/shell-scripts/src/branch/main/helium-browser/helium_helper.sh)
- Desktop entry updater [Helper Script](https://lab.c95.org/fr4nz/shell-scripts/src/branch/main/helium-browser/helium_helper.sh)
- create help function
## Repo
- Merge workflow
- Convert URLs from __main__ to __stable__
- Remove to do list
- Remove comment from script
## Notes
```sh
############# TO DO
while true ; do
read -p " Enable automatic update check on login? (y/N) : " AUTO_UPDATE
if [[ "$AUTO_UPDATE" == "" || "$AUTO_UPDATE" == "n" || "$AUTO_UPDATE" == "N" ]] ; then
break
elif [[ "$AUTO_UPDATE" == "y" || "$AUTO_UPDATE" == "Y" ]] ; then
if ! [ -f "$PROFILE" ] ; then
echo -e "\n ${RED}Following file is missing :\n\n${YEL}$PROFILE\n\n ${CYN}Please investigate and re-run script !${CRS}"
exit 1
else
wget -P $TMP https://lab.c95.org/fr4nz/shell-scripts/src/branch/main/helium-browser/helium_auto_update.sh -q --show-progress
chmod +x $TMP/helium_auto_update.sh
mv $TMP/helium_auto_update.sh $INSTALL_PATH/helium_auto_update.sh
echo >> $PROFILE
echo "### HELIUM AUTO UPDATE ###" >> $PROFILE
echo "${INSTALL_PATH}/helium_auto_update.sh" >> $PROFILE
echo >> $PROFILE
echo -e "\n ${GRN}Automatic updates enabled ! ${CRS}\n"
break
fi
else
echo -e " ${YEL}Invalid response !${CRS}\n"
fi
done
#############
```