Compare commits
No commits in common. "main" and "0.5.6" have entirely different histories.
6 changed files with 318 additions and 1014 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
test.sh
|
|
||||||
binaries
|
|
||||||
95
README.md
95
README.md
|
|
@ -1,76 +1,20 @@
|
||||||
# Helium Bowser installer & updater
|
# Helium Bowser installer & updater
|
||||||
## Purpose
|
## Purpose
|
||||||
This script was initially designed to just update my Helium browser but over time and interest it got more functional and universal. It includes functions to install, update, remove, add launcher, etc... It's supposed to run in user space and is (Linux) distro independent I suppose.
|
This script was initially designed to just update my Helium browser but over time and interest it got more functional and universal. With "little" tinkering it should be possible to apply this script to install, update & configure many kinds of releases from source like AppImages, binaries, etc...
|
||||||
|
|
||||||
With "little" tinkering it should be possible to apply this script to install, update & configure many kinds of releases from source, like Debian packages, AppImages, binaries, etc...
|
|
||||||
## Usage
|
|
||||||
### Help
|
|
||||||
```sh
|
|
||||||
./helium_helper.sh -h
|
|
||||||
```
|
|
||||||
---
|
|
||||||
### First Install
|
|
||||||
To initally install Helium browser via this script, download `helium_helper.sh` and make it executable:
|
|
||||||
```sh
|
|
||||||
wget https://lab.c95.org/fr4nz/helium-helper/raw/branch/main/helium_helper.sh && chmod +x helium_helper.sh
|
|
||||||
```
|
|
||||||
Run script with install parameter _-i_
|
|
||||||
- Default install directory = `$HOME/.apps/Helium`
|
|
||||||
```sh
|
|
||||||
./helium_helper.sh -i
|
|
||||||
```
|
|
||||||
|
|
||||||
**OPTIONAL** : Add alias to `.shellrc` | _working in zsh, bash & fish_
|
|
||||||
- Default alias = `update-helium`
|
|
||||||
```sh
|
|
||||||
./helium_helper.sh -a
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
### Updating
|
|
||||||
**From launcher** (if added during install or by running `./helium_helper.sh -l`)
|
|
||||||
|
|
||||||
Checking for the latest version and updating can simply be done for the browser as well as the script by right clicking the app icon and choosing either update option, which will be run by `helium_launcher_update.sh`. This will backup all files and configuration and write a log.
|
|
||||||
|
|
||||||
**Terminal**
|
|
||||||
|
|
||||||
Updating can also be done by running:
|
|
||||||
- Update Helium Browser
|
|
||||||
```sh
|
|
||||||
./helium_helper.sh -u
|
|
||||||
```
|
|
||||||
- Update Helium Helper
|
|
||||||
```sh
|
|
||||||
./helium_helper.sh -S
|
|
||||||
```
|
|
||||||
---
|
|
||||||
### Backing up
|
|
||||||
Backing up, by default, pulls all important files, folders & configuration and compresses an archive, which is stored in `$HOME/.apps/Helium/assets`
|
|
||||||
- Default backup
|
|
||||||
```sh
|
|
||||||
./helium_helper.sh -b
|
|
||||||
```
|
|
||||||
- Backup to custom path
|
|
||||||
```sh
|
|
||||||
./helium_helper.sh -b </PATH/TO/DESTINATION>
|
|
||||||
```
|
|
||||||
**NOTE:** The backup path specified won't be overridden within the script yet. Working on it...
|
|
||||||
|
|
||||||
**Since this script is interactive, it doesn't keep logs.**
|
|
||||||
## Overview
|
## Overview
|
||||||
### Helium_Helper.sh
|
### Helium_Helper.sh
|
||||||
- Interactive installer, updater & configuration script
|
- Interactive installer, updater & configuration script
|
||||||
- Installs to `$HOME/.apps/Helium` | changeable in line 32 `INSTALL_PATH`
|
- Installs to `/home/<USER>/.apps/Helium` | changeable in line 28 `INSTALL_PATH`
|
||||||
- Assumes:
|
- Assumes:
|
||||||
- Presence of `$HOME/.apps/Helium` when updating | changeable in line 32 `INSTALL_PATH`
|
- Presence of `/home/<USER>/.apps/Helium` when updating | changeable in line 28 `INSTALL_PATH`
|
||||||
- Executable named `Helium.AppImage`
|
- Executable named `Helium.AppImage`
|
||||||
- Keeps backup archives from
|
- Keeps backups of
|
||||||
- `Helium.AppImage`
|
- `Helium.AppImage` --> `Helium.AppImage.old`
|
||||||
- `helium_helper.sh`
|
- `helium_helper.sh` --> `helium_helper.sh.old`
|
||||||
- `helium_launcher_update.sh`
|
- `helium_launcher_update.sh` --> `helium_launcher_update.sh.old`
|
||||||
- `Helium.desktop`
|
- `Helium.desktop` --> `Helium.desktop.old`
|
||||||
- `net.imput.helium`
|
which will be overwritten at every update
|
||||||
- Adds desktop launcher to `$HOME/.local/share/applications`
|
- Adds desktop launcher to `/home/<USER>/.local/share/applications`
|
||||||
- Adds options to launcher which are run by `helium_launcher_updater.sh`
|
- Adds options to launcher which are run by `helium_launcher_updater.sh`
|
||||||
- Update Helium
|
- Update Helium
|
||||||
- Update Script
|
- Update Script
|
||||||
|
|
@ -80,14 +24,13 @@ Backing up, by default, pulls all important files, folders & configuration and c
|
||||||
### Helium_Launcher_Update.sh
|
### Helium_Launcher_Update.sh
|
||||||
- Update Helium from launcher
|
- Update Helium from launcher
|
||||||
- Assumes:
|
- Assumes:
|
||||||
- Presence of `$HOME/.apps/Helium` when updating | changeable in line 21 `INSTALL_PATH`
|
- Presence of `/home/<USER>/.apps/Helium` when updating | changeable in line 19 `INSTALL_PATH`
|
||||||
- Executable named `Helium.AppImage`
|
- Executable named `Helium.AppImage`
|
||||||
- Loggs to `$HOME/.apps/Helium/assets/logs`
|
- Loggs to `/home/<USER>/.apps/Helium/assets/logs`
|
||||||
- Keeps backup archives from
|
- Keeps backups of
|
||||||
- `Helium.AppImage`
|
- `Helium.AppImage` --> `Helium.AppImage.old`
|
||||||
- `helium_helper.sh`
|
- `helium_helper.sh` --> `helium_helper.sh.old`
|
||||||
- `helium_launcher_update.sh`
|
- `helium_launcher_update.sh` --> `helium_launcher_update.sh.old`
|
||||||
- `Helium.desktop`
|
- `Helium.desktop` --> `Helium.desktop.old`
|
||||||
- `net.imput.helium`
|
which will be overwritten at every update
|
||||||
- Run `helium_launcher_update.sh -h` for help
|
- Run `helium_launcher_update.sh -h` for help
|
||||||
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
on:
|
|
||||||
pull_requests:
|
|
||||||
pull_request_target:
|
|
||||||
973
helium_helper.sh
973
helium_helper.sh
File diff suppressed because it is too large
Load diff
|
|
@ -1,28 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# HELIUM BOWSER AUTO UPDATE SCRIPT WITH LOGGING
|
# HELIUM BOWSER AUTO UPDATE SCRIPT WITH LOGGING
|
||||||
|
|
||||||
########## PREREQUISITES ###########
|
########## PREREQUISITES ###########
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
## GLOBAL VARIABLES
|
## GLOBAL VARIABLES
|
||||||
APP_NAME="Helium"
|
APP_NAME="Helium"
|
||||||
APP_NAME_LONG="Helium Web Browser"
|
APP_NAME_LONG="Helium Web Browser"
|
||||||
ARCH="x86_64"
|
SOURCE="GitHub"
|
||||||
FILE_EXTENSION="AppImage"
|
SCRIPT_NAME="$APP_NAME launcher updater"
|
||||||
APP_SOURCE="GitHub"
|
|
||||||
SCRIPT_NAME="$APP_NAME Launcher Updater"
|
|
||||||
PARENT_SCRIPT_FILE_NAME="helium_helper.sh"
|
|
||||||
SCRIPT_FILE_NAME="helium_launcher_update.sh"
|
SCRIPT_FILE_NAME="helium_launcher_update.sh"
|
||||||
SCRIPT_VERSION="0.5.9.1"
|
SCRIPT_VERSION="0.5.6"
|
||||||
LOG_DATE=$(date)
|
DATE=$(date)
|
||||||
DATE=$(date +"%d%m%y")
|
|
||||||
|
|
||||||
## NOTIFICATIONS
|
|
||||||
NOTIFY_NAME="Helium Helper"
|
|
||||||
|
|
||||||
## LOCATIONS
|
## LOCATIONS
|
||||||
TMP=/tmp/$APP_NAME
|
TMP=/tmp/$APP_NAME
|
||||||
INSTALL_PATH=$HOME/.apps/$APP_NAME
|
INSTALL_PATH=$HOME/.apps/$APP_NAME
|
||||||
APP_CONFIG_PATH=$HOME/.config/net.imput.helium
|
|
||||||
ASSET_PATH=$INSTALL_PATH/assets
|
ASSET_PATH=$INSTALL_PATH/assets
|
||||||
BACKUP_PATH=$ASSET_PATH/backup
|
BACKUP_PATH=$ASSET_PATH/backup
|
||||||
LOG_PATH=$ASSET_PATH/logs
|
LOG_PATH=$ASSET_PATH/logs
|
||||||
|
|
@ -32,10 +26,9 @@ ICON=$ASSET_PATH/icon/helium.png
|
||||||
SCRIPT_PATH=$HOME/.local/bin
|
SCRIPT_PATH=$HOME/.local/bin
|
||||||
|
|
||||||
## REMOTE LOCATIONS
|
## REMOTE LOCATIONS
|
||||||
REMOTE_REPO_BRANCH="main"
|
REMOTE_REPO_URL=https://lab.c95.org/fr4nz/helium-helper/raw/branch/main
|
||||||
REMOTE_REPO_URL=https://lab.c95.org/fr4nz/helium-helper/raw/branch/$REMOTE_REPO_BRANCH
|
|
||||||
REMOTE_SCRIPT_URL=$REMOTE_REPO_URL/$SCRIPT_FILE_NAME
|
REMOTE_SCRIPT_URL=$REMOTE_REPO_URL/$SCRIPT_FILE_NAME
|
||||||
APP_SOURCE_URL=https://api.github.com/repos/imputnet/helium-linux/releases/latest
|
SOURCE_URL=https://api.github.com/repos/imputnet/helium-linux/releases/latest
|
||||||
|
|
||||||
########## FUNCTIONS ###########
|
########## FUNCTIONS ###########
|
||||||
|
|
||||||
|
|
@ -62,131 +55,39 @@ dependency_check () {
|
||||||
mkdir -p $LOG_PATH
|
mkdir -p $LOG_PATH
|
||||||
echo "########## $APP_NAME_LONG update log ##########" >> $LOG
|
echo "########## $APP_NAME_LONG update log ##########" >> $LOG
|
||||||
echo >> $LOG
|
echo >> $LOG
|
||||||
echo "$LOG_DATE | Log created" >> $LOG
|
echo "${DATE} | Log created" >> $LOG
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$TMP/missingDeps" ] ; then
|
if [ -f "$TMP/missingDeps" ] ; then
|
||||||
MISSING=$(cat $TMP/missingDeps)
|
MISSING=$(cat $TMP/missingDeps)
|
||||||
echo "$LOG_DATE | Failed to update - missing dependencies : $MISSING" >> $LOG
|
echo "${DATE} | Failed to update - missing dependencies : $MISSING" >> $LOG
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Update failed! See log for details"
|
notify-send -i "$ICON" "Helium Helper" "Update failed! See log for details"
|
||||||
exit_clean
|
exit_clean
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -d "$INSTALL_PATH" ] ; then
|
if ! [ -d "$INSTALL_PATH" ] ; then
|
||||||
mkdir -p $INSTALL_PATH
|
mkdir -p $INSTALL_PATH
|
||||||
echo "$LOG_DATE | Failed to update - $APP_NAME installation path not present - But created for logging" >> $LOG
|
echo "${DATE} | Failed to update - $APP_NAME installation path not present - But created for logging" >> $LOG
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Update failed! See log for details"
|
notify-send -i "$ICON" "Helium Helper" "Update failed! See log for details"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
elif ! [ -f "$INSTALL_PATH/$APP_NAME.$FILE_EXTENSION" ] ; then
|
elif ! [ -f "$INSTALL_PATH/$APP_NAME.AppImage" ] ; then
|
||||||
echo "$LOG_DATE | Failed to update - Local $APP_NAME AppImage not found" >> $LOG
|
echo "${DATE} | Failed to update - Local $APP_NAME AppImage not found" >> $LOG
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Update failed! See log for details"
|
notify-send -i "$ICON" "Helium Helper" "Update failed! See log for details"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
### DE CHECK
|
|
||||||
desktop_environment() {
|
|
||||||
ALTERNATIVE_NOTIFY="--app-name="$NOTIFY_NAME""
|
|
||||||
|
|
||||||
if [[ "$(echo $XDG_CURRENT_DESKTOP | grep -iF "kde")" || "$(echo $XDG_CURRENT_DESKTOP | grep -iF "gnome")" ]] ; then
|
|
||||||
NOTIFY_NAME=$ALTERNATIVE_NOTIFY
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
### BACKUP
|
|
||||||
backup_helium() {
|
|
||||||
if [[ -d "$INSTALL_PATH" || -d "$SCRIPT_PATH" || -d $APP_CONFIG_PATH ]] ; then
|
|
||||||
BACKUPABLE=("$INSTALL_PATH/$APP_NAME.$FILE_EXTENSION" "$SCRIPT_PATH/$SCRIPT_FILE_NAME" "$SCRIPT_PATH/$AUTO_SCRIPT_FILE_NAME" "$LAUNCHER_PATH/$APP_NAME.desktop" "$APP_CONFIG_PATH")
|
|
||||||
|
|
||||||
for BACKUP_ITEM in ${BACKUPABLE[@]} ; do
|
|
||||||
if [ -d "$BACKUP_ITEM" ] ; then
|
|
||||||
mkdir -p $TMP/backup
|
|
||||||
cp -r $BACKUP_ITEM $TMP/backup
|
|
||||||
|
|
||||||
elif [ -f "$BACKUP_ITEM" ] ; then
|
|
||||||
mkdir -p $TMP/backup
|
|
||||||
cp $BACKUP_ITEM $TMP/backup
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -d "$TMP/backup" ] ; then
|
|
||||||
CWD=$(pwd)
|
|
||||||
cd $TMP/backup
|
|
||||||
chmod -x *.sh *.$FILE_EXTENSION > /dev/null 2>&1
|
|
||||||
|
|
||||||
if [ "$BACKUP_COMPRESSION_OVERRIDE" ] ; then
|
|
||||||
BACKUP_COMPRESSION=$BACKUP_COMPRESSION_OVERRIDE
|
|
||||||
|
|
||||||
elif ! [ "$BACKUP_COMPRESSION_OVERRIDE" ] ; then
|
|
||||||
COMPRESSION_METHOD=("pbzip2" "gzip" "bzip2" "zip")
|
|
||||||
|
|
||||||
until [ "$BACKUP_COMPRESSION" ] ; do
|
|
||||||
for COMPRESSION_TYPE in ${COMPRESSION_METHOD[@]} ; do
|
|
||||||
|
|
||||||
if [ "$(command -v $COMPRESSION_TYPE) > /dev/null 2>&1" ] ; then
|
|
||||||
BACKUP_COMPRESSION=$COMPRESSION_TYPE
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$BACKUP_COMPRESSION" == "pbzip2" ] ; then
|
|
||||||
tar -cf $APP_NAME.auto_backup_$DATE.tar * > /dev/null 2>&1
|
|
||||||
pbzip2 $APP_NAME.auto_backup_$DATE.tar
|
|
||||||
mkdir -p $BACKUP_PATH
|
|
||||||
mv $APP_NAME.auto_backup_$DATE.tar.bz2 $BACKUP_PATH
|
|
||||||
cd $TMP && rm -rf backup
|
|
||||||
|
|
||||||
elif [ "$BACKUP_COMPRESSION" == "gzip" ] ; then
|
|
||||||
tar -cf $APP_NAME.auto_backup_$DATE.tar * > /dev/null 2>&1
|
|
||||||
gzip $APP_NAME.auto_backup_$DATE.tar
|
|
||||||
mkdir -p $BACKUP_PATH
|
|
||||||
mv $APP_NAME.auto_backup_$DATE.tar.gz $BACKUP_PATH
|
|
||||||
cd $TMP && rm -rf backup
|
|
||||||
|
|
||||||
elif [ "$BACKUP_COMPRESSION" == "bzip2" ] ; then
|
|
||||||
tar -cf $APP_NAME.auto_backup_$DATE.tar * > /dev/null 2>&1
|
|
||||||
bzip2 $APP_NAME.auto_backup_$DATE.tar
|
|
||||||
mkdir -p $BACKUP_PATH
|
|
||||||
mv $APP_NAME.auto_backup_$DATE.tar.bz2 $BACKUP_PATH
|
|
||||||
cd $TMP && rm -rf backup
|
|
||||||
|
|
||||||
elif [ "$BACKUP_COMPRESSION" == "zip" ] ; then
|
|
||||||
tar -cf $APP_NAME.auto_backup_$DATE.tar * > /dev/null 2>&1
|
|
||||||
zip -r $APP_NAME.auto_backup_$DATE.tar.zip $APP_NAME.auto_backup_$DATE.tar > /dev/null 2>&1
|
|
||||||
mkdir -p $BACKUP_PATH
|
|
||||||
mv $APP_NAME.auto_backup_$DATE.tar.zip $BACKUP_PATH
|
|
||||||
cd $TMP && rm -rf backup
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "$LOG_DATE | Backup (uncompressed) written to $BACKUP_PATH" >> $LOG
|
|
||||||
mkdir -p $BACKUP_PATH
|
|
||||||
mv $TMP/backup $BACKUP_PATH/$APP_NAME.auto_backup_$DATE
|
|
||||||
cd $TMP && rm -rf backup
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$LOG_DATE | Backup (compressed $BACKUP_COMPRESSION archive) written to $BACKUP_PATH" >> $LOG
|
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Backup created"
|
|
||||||
cd $CWD
|
|
||||||
fi
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "$LOG_DATE | Failed to backup - Nothing worth backing up found" >> $LOG
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
### UPDATE SCRIPT
|
### UPDATE SCRIPT
|
||||||
update_script() {
|
update_script() {
|
||||||
### CHECK FOR LOCAL SCRIPT
|
### CHECK FOR LOCAL SCRIPT
|
||||||
if ! [ -f "$SCRIPT_PATH/$SCRIPT_FILE_NAME" ] ; then
|
if ! [ -f "$SCRIPT_PATH/$SCRIPT_FILE_NAME" ] ; then
|
||||||
echo "$LOG_DATE | Failed to update script - local file not found" >> $LOG
|
echo "${DATE} | Failed to update script - local file not found" >> $LOG
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Script update failed! See log for details"
|
notify-send -i "$ICON" "Helium Helper" "Script update failed! See log for details"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
@ -195,13 +96,13 @@ update_script() {
|
||||||
|
|
||||||
### CHECK FOR EMPTY VERSION TAGS
|
### CHECK FOR EMPTY VERSION TAGS
|
||||||
if [ -z "$SCRIPT_VERSION" ] ; then
|
if [ -z "$SCRIPT_VERSION" ] ; then
|
||||||
echo "$LOG_DATE | Failed to update script - Empty version tag --> local" >> $LOG
|
echo "${DATE} | Failed to update script - Empty version tag --> local" >> $LOG
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Script update failed! See log for details"
|
notify-send -i "$ICON" "Helium Helper" "Script update failed! See log for details"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
elif [ -z "$REMOTE_SCRIPT_VERSION" ] ; then
|
elif [ -z "$REMOTE_SCRIPT_VERSION" ] ; then
|
||||||
echo "$LOG_DATE | Failed to update script - Empty version tag --> $APP_SOURCE" >> $LOG
|
echo "${DATE} | Failed to update script - Empty version tag --> $SOURCE" >> $LOG
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Script update failed! See log for details"
|
notify-send -i "$ICON" "Helium Helper" "Script update failed! See log for details"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
@ -211,66 +112,68 @@ update_script() {
|
||||||
REMOTE_SCRIPT_VERSION_NUM=$(echo $REMOTE_SCRIPT_VERSION | tr -d .)
|
REMOTE_SCRIPT_VERSION_NUM=$(echo $REMOTE_SCRIPT_VERSION | tr -d .)
|
||||||
|
|
||||||
if [ "$REMOTE_SCRIPT_VERSION" == "$SCRIPT_VERSION" ] ; then
|
if [ "$REMOTE_SCRIPT_VERSION" == "$SCRIPT_VERSION" ] ; then
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Script is up-to-date"
|
notify-send -i "$ICON" "Helium Helper" "Script is up-to-date"
|
||||||
|
|
||||||
elif [ "$REMOTE_SCRIPT_VERSION_NUM" -gt "$SCRIPT_VERSION_NUM" ] ; then
|
elif [ "$REMOTE_SCRIPT_VERSION_NUM" -gt "$SCRIPT_VERSION_NUM" ] ; then
|
||||||
mv $SCRIPT_PATH/$SCRIPT_FILE_NAME $BACKUP_PATH/$SCRIPT_FILE_NAME.old
|
mv $SCRIPT_PATH/$SCRIPT_FILE_NAME $BACKUP_PATH/$SCRIPT_FILE_NAME.old
|
||||||
mkdir -p $TMP
|
mkdir -p $TMP
|
||||||
wget -P $TMP $REMOTE_SCRIPT_URL -q
|
wget -P $TMP $REMOTE_SCRIPT_URL -q
|
||||||
wget -P $TMP $REMOTE_REPO_URL/$PARENT_SCRIPT_FILE_NAME -q
|
chmod +x $TMP/$SCRIPT_FILE_NAME
|
||||||
chmod +x $TMP/$SCRIPT_FILE_NAME $TMP/$PARENT_SCRIPT_FILE_NAME
|
mv $TMP/$SCRIPT_FILE_NAME $SCRIPT_PATH
|
||||||
mv $TMP/$SCRIPT_FILE_NAME $TMP/$PARENT_SCRIPT_FILE_NAME $SCRIPT_PATH
|
echo "${DATE} | Script updated to $REMOTE_SCRIPT_VERSION" >> $LOG
|
||||||
echo "$LOG_DATE | Script updated to version $REMOTE_SCRIPT_VERSION" >> $LOG
|
notify-send -i "$ICON" "Helium Helper" "Script updated to $REMOTE_SCRIPT_VERSION"
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Script updated to version $REMOTE_SCRIPT_VERSION"
|
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "$LOG_DATE | Failed to update - Malformed version tags" >> $LOG
|
echo "${DATE} | Failed to update - Malformed version tags" >> $LOG
|
||||||
echo "$LOG_DATE | Remote Version: $REMOTE_SCRIPT_VERSION" >> $LOG
|
notify-send -i "$ICON" "Helium Helper" "Script update failed! See log for details\n$REMOTE_SCRIPT_VERSION $SCRIPT_VERSION"
|
||||||
echo "$LOG_DATE | Local Version: $SCRIPT_VERSION" >> $LOG
|
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Script update failed! See log for details"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
### UPDATE
|
### UPDATE
|
||||||
update_helium() {
|
update_helium() {
|
||||||
DOWNLOAD_URL=$(curl -s $APP_SOURCE_URL | grep "browser_download_url" | grep "$ARCH.$FILE_EXTENSION" | grep -v "zsync" | tr -d \" | awk '{print $2}')
|
DOWNLOAD_URL=$(curl -s $SOURCE_URL | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}')
|
||||||
APP_SOURCE_FILENAME=$(curl -s $APP_SOURCE_URL | grep "browser_download_url" | grep "$ARCH.$FILE_EXTENSION" | grep -v "zsync" | tr -d \" | awk '{print $2}' | awk -F'/' '{print $9}')
|
SOURCE_FILENAME=$(curl -s $SOURCE_URL | grep "browser_download_url" | grep "x86_64.AppImage" | grep -v "zsync" | tr -d \" | awk '{print $2}' | awk -F'/' '{print $9}')
|
||||||
LOCAL_VERSION=$($INSTALL_PATH/$APP_NAME.$FILE_EXTENSION --version | awk '{print $2}')
|
LOCAL_VERSION=$($INSTALL_PATH/$APP_NAME.AppImage --version | awk '{print $2}')
|
||||||
APP_SOURCE_VERSION=$(curl -s $APP_SOURCE_URL | grep "tag_name" | tr -d \", | awk '{print $2}')
|
SOURCE_VERSION=$(curl -s $SOURCE_URL | grep "tag_name" | tr -d \", | awk '{print $2}')
|
||||||
|
|
||||||
### CHECK FOR EMPTY VERSION TAGS
|
### CHECK FOR EMPTY VERSION TAGS
|
||||||
if [[ -z "$APP_SOURCE_VERSION" ]] ; then
|
if [[ -z "$SOURCE_VERSION" ]] ; then
|
||||||
echo "$LOG_DATE | Failed to update - Empty version tag --> $APP_SOURCE" >> $LOG
|
echo "${DATE} | Failed to update - Empty version tag --> $SOURCE" >> $LOG
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Browser update failed! See log for details"
|
notify-send -i "$ICON" "Helium Helper" "Browser update failed! See log for details"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
elif [[ -z "$LOCAL_VERSION" ]] ; then
|
elif [[ -z "$LOCAL_VERSION" ]] ; then
|
||||||
echo "$LOG_DATE | Failed to update - Empty version tag --> LOCAL" >> $LOG
|
echo "${DATE} | Failed to update - Empty version tag --> LOCAL" >> $LOG
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Browser update failed! See log for details"
|
notify-send -i "$ICON" "Helium Helper" "Browser update failed! See log for details"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### COMPARE LOCAL & REMOTE VERSION
|
### COMPARE LOCAL & REMOTE VERSION
|
||||||
LOCAL_VERSION_NUM=$(echo $LOCAL_VERSION | tr -d .)
|
LOCAL_VERSION_NUM=$(echo $LOCAL_VERSION | tr -d .)
|
||||||
APP_SOURCE_VERSION_NUM=$(echo $APP_SOURCE_VERSION | tr -d .)
|
SOURCE_VERSION_NUM=$(echo $SOURCE_VERSION | tr -d .)
|
||||||
|
|
||||||
if [ "$APP_SOURCE_VERSION" == "$LOCAL_VERSION" ] ; then
|
if [ "$SOURCE_VERSION" == "$LOCAL_VERSION" ] ; then
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Browser is up-to-date"
|
notify-send -i "$ICON" "Helium Helper" "Browser is up-to-date"
|
||||||
|
|
||||||
elif [ "$APP_SOURCE_VERSION_NUM" -gt "$LOCAL_VERSION_NUM" ] ; then
|
elif [ "$SOURCE_VERSION_NUM" -gt "$LOCAL_VERSION_NUM" ] ; then
|
||||||
mkdir -p $TMP
|
mkdir -p $TMP $BACKUP_PATH
|
||||||
wget -P $TMP $DOWNLOAD_URL -q
|
wget -P $TMP $DOWNLOAD_URL -q --show-progress
|
||||||
chmod +x $TMP/$APP_SOURCE_FILENAME
|
chmod +x $TMP/$SOURCE_FILENAME
|
||||||
backup_helium
|
if [ -f "$BACKUP_PATH/$APP_NAME.AppImage.old" ] ; then
|
||||||
mv $TMP/$APP_SOURCE_FILENAME $INSTALL_PATH/$APP_NAME.$FILE_EXTENSION
|
rm $BACKUP_PATH/$APP_NAME.AppImage.old
|
||||||
sed -i "s|X-AppImage-Version=.*|X-AppImage-Version=$($INSTALL_PATH/$APP_NAME.$FILE_EXTENSION --version | awk '{print $2}')|" $LAUNCHER_PATH/$APP_NAME.desktop
|
fi
|
||||||
echo "$LOG_DATE | $APP_NAME updated to version ${APP_SOURCE_VERSION}" >> $LOG
|
mv $INSTALL_PATH/$APP_NAME.AppImage $BACKUP_PATH/$APP_NAME.AppImage.old
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Browser updated to version $APP_SOURCE_VERSION"
|
mv $TMP/$SOURCE_FILENAME $INSTALL_PATH/$APP_NAME.AppImage
|
||||||
|
cp $LAUNCHER_PATH/$APP_NAME.desktop $BACKUP_PATH/$APP_NAME.desktop.old
|
||||||
|
sed -i "s|X-AppImage-Version=.*|X-AppImage-Version=$($INSTALL_PATH/$APP_NAME.AppImage --version | awk '{print $2}')|" $LAUNCHER_PATH/$APP_NAME.desktop
|
||||||
|
echo "${DATE} | $APP_NAME updated to ${SOURCE_VERSION}" >> $LOG
|
||||||
|
notify-send -i "$ICON" "Helium Helper" "Browser updated to $SOURCE_VERSION"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "$LOG_DATE | Failed to update - Version tags malformed" >> $LOG
|
echo "${DATE} | Failed to update - Version tags malformed" >> $LOG
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "Browser update failed! See log for details"
|
notify-send -i "$ICON" "Helium Helper" "Browser update failed! See log for details"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
@ -289,7 +192,7 @@ show_log() {
|
||||||
xdg-open $LOG
|
xdg-open $LOG
|
||||||
|
|
||||||
else
|
else
|
||||||
notify-send --icon="$ICON" "$NOTIFY_NAME" "No log created yet"
|
notify-send -i "$ICON" "Helium Helper" "No log created yet"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -326,13 +229,6 @@ exit_clean() {
|
||||||
|
|
||||||
## GET OPTIONS
|
## GET OPTIONS
|
||||||
while getopts ":a,:s,:S,:L,:h" OPTION ; do
|
while getopts ":a,:s,:S,:L,:h" OPTION ; do
|
||||||
|
|
||||||
if [ "$(echo $1 | wc -m)" -gt "3" ] ; then
|
|
||||||
echo -e "\n${YEL}Option ${RED}$1${YEL} not valid! Use only one parameter at a time...${CRS}"
|
|
||||||
help
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
|
|
||||||
S)
|
S)
|
||||||
|
|
@ -364,11 +260,8 @@ done
|
||||||
## DEPENDENCY CHECK
|
## DEPENDENCY CHECK
|
||||||
dependency_check
|
dependency_check
|
||||||
|
|
||||||
## DE CHECK
|
|
||||||
desktop_environment
|
|
||||||
|
|
||||||
## UPDATE
|
## UPDATE
|
||||||
update_helium
|
update_helium
|
||||||
|
|
||||||
## CLEAN
|
## CLEAN
|
||||||
exit_clean
|
exit_clean
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
- Launcher has an update option now
|
- Launcher has an update option now
|
||||||
- Launcher installer refined
|
- Launcher installer refined
|
||||||
- Clean Up
|
- Clean Up
|
||||||
---
|
|
||||||
- Script updater
|
- Script updater
|
||||||
- Remote script check simplified
|
- Remote script check simplified
|
||||||
- Remover function extended
|
- Remover function extended
|
||||||
|
|
@ -19,39 +18,16 @@
|
||||||
- Show log option added
|
- Show log option added
|
||||||
- Variables universalized
|
- Variables universalized
|
||||||
- Wiki created
|
- Wiki created
|
||||||
---
|
|
||||||
- sed command fixed in remover
|
|
||||||
- ARCH variable added
|
|
||||||
- APP_SOURCE variable changed
|
|
||||||
- BRANCH variable added
|
|
||||||
- FILE_EXTENSION variable added
|
|
||||||
- Readme updated
|
|
||||||
- Documentation/Wiki updated
|
|
||||||
---
|
|
||||||
- Shell detection added
|
|
||||||
- Alias support for fish added
|
|
||||||
- Removal process refined and adapted to fish
|
|
||||||
- Browser config backup
|
|
||||||
---
|
|
||||||
- Arch detection working
|
|
||||||
- Clean Up
|
|
||||||
- Copy Paste mistake fixed
|
|
||||||
- Backup process rewritten
|
|
||||||
- Custom backup method to pass as argument
|
|
||||||
- Custom backup path to pass as argument
|
|
||||||
- Default if left blank
|
|
||||||
- Removal process adjusted
|
|
||||||
- $1 verifier added
|
|
||||||
- Readme updated
|
|
||||||
---
|
|
||||||
- Notification adjusted for KDE & GNOME
|
|
||||||
|
|
||||||
|
|
||||||
## Add/To Do
|
## Add/To Do
|
||||||
|
- Architecture detection
|
||||||
|
- Set alias --> Partially
|
||||||
|
- shell recognition missing
|
||||||
- Roll back from backup
|
- Roll back from backup
|
||||||
|
- Config check
|
||||||
|
- Simplification & Clean Up
|
||||||
- Update Readme
|
- Update Readme
|
||||||
- Make functional launcher optional
|
- Make functional launcher optional
|
||||||
- Variable transfer script
|
|
||||||
|
|
||||||
## Repo
|
## Repo
|
||||||
- Merge workflow
|
- Merge workflow
|
||||||
Loading…
Add table
Add a link
Reference in a new issue