Desktop notifications added
This commit is contained in:
parent
4a6741f581
commit
5ad81a5997
1 changed files with 21 additions and 9 deletions
|
|
@ -86,6 +86,8 @@ update_script() {
|
|||
### CHECK FOR LOCAL SCRIPT
|
||||
if ! [ -f "$SCRIPT_PATH/$SCRIPT_FILE_NAME" ] ; then
|
||||
echo "${DATE} | Failed to update script - local file not found" >> $LOG
|
||||
notify-send "Helium Helper" "Script update failed! See log for details"
|
||||
exit
|
||||
|
||||
fi
|
||||
|
||||
|
|
@ -94,9 +96,13 @@ update_script() {
|
|||
### CHECK FOR EMPTY VERSION TAGS
|
||||
if [ -z "$SCRIPT_VERSION" ] ; then
|
||||
echo "${DATE} | Failed to update script - Empty version tag --> local" >> $LOG
|
||||
notify-send "Helium Helper" "Script update failed! See log for details"
|
||||
exit
|
||||
|
||||
elif [ -z "$REMOTE_SCRIPT_VERSION" ] ; then
|
||||
echo "${DATE} | Failed to update script - Empty version tag --> $SOURCE" >> $LOG
|
||||
notify-send "Helium Helper" "Script update failed! See log for details"
|
||||
exit
|
||||
|
||||
fi
|
||||
|
||||
|
|
@ -105,15 +111,17 @@ update_script() {
|
|||
REMOTE_SCRIPT_VERSION_NUM=$(echo $REMOTE_SCRIPT_VERSION | tr -d .)
|
||||
|
||||
if [ "$REMOTE_SCRIPT_VERSION" == "$SCRIPT_VERSION" ] ; then
|
||||
:
|
||||
notify-send "Helium Helper" "Script is up-to-date"
|
||||
|
||||
elif [ "$REMOTE_SCRIPT_VERSION_NUM" -gt "$SCRIPT_VERSION_NUM" ] ; then
|
||||
mv $SCRIPT_PATH/$SCRIPT_FILE_NAME $BACKUP_PATH/$SCRIPT_FILE_NAME.old
|
||||
mv $TMP/$SCRIPT_FILE_NAME $SCRIPT_PATH
|
||||
echo "${DATE} | Script updated" >> $LOG
|
||||
notify-send "Helium Helper" "Script updated"
|
||||
|
||||
else
|
||||
echo "${DATE} | Failed to update - Malformed version tags" >> $LOG
|
||||
notify-send "Helium Helper" "Script update failed! See log for details"
|
||||
|
||||
fi
|
||||
}
|
||||
|
|
@ -128,10 +136,12 @@ update_helium() {
|
|||
### CHECK FOR EMPTY VERSION TAGS
|
||||
if [[ -z "$GIT_VERSION" ]] ; then
|
||||
echo "${DATE} | Failed to update - Empty version tag --> $SOURCE" >> $LOG
|
||||
notify-send "Helium Helper" "Browser update failed! See log for details"
|
||||
exit
|
||||
|
||||
elif [[ -z "$LOCAL_VERSION" ]] ; then
|
||||
echo "${DATE} | Failed to update - Empty version tag --> LOCAL" >> $LOG
|
||||
notify-send "Helium Helper" "Browser update failed! See log for details"
|
||||
exit
|
||||
|
||||
fi
|
||||
|
|
@ -141,7 +151,7 @@ update_helium() {
|
|||
GIT_VERSION_NUM=$(echo $GIT_VERSION | tr -d .)
|
||||
|
||||
if [ "$GIT_VERSION" == "$LOCAL_VERSION" ] ; then
|
||||
:
|
||||
notify-send "Helium Helper" "Browser is up-to-date"
|
||||
|
||||
elif [ "$GIT_VERSION_NUM" -gt "$LOCAL_VERSION_NUM" ] ; 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}')
|
||||
|
|
@ -157,9 +167,11 @@ update_helium() {
|
|||
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 ${GIT_VERSION}" >> $LOG
|
||||
notify-send "Helium Helper" "Browser updated to $GIT_VERSION"
|
||||
|
||||
else
|
||||
echo "${DATE} | Failed to update - Version tags malformed" >> $LOG
|
||||
notify-send "Helium Helper" "Browser update failed! See log for details"
|
||||
exit
|
||||
|
||||
fi
|
||||
|
|
@ -204,22 +216,22 @@ exit_clean() {
|
|||
while getopts ":a,:s,:h" OPTION ; do
|
||||
case $OPTION in
|
||||
|
||||
a)
|
||||
add_alias
|
||||
exit ;;
|
||||
S)
|
||||
update_script
|
||||
exit_clean ;;
|
||||
|
||||
s)
|
||||
script_version
|
||||
exit ;;
|
||||
exit_clean ;;
|
||||
|
||||
h)
|
||||
help
|
||||
exit ;;
|
||||
exit_clean ;;
|
||||
|
||||
*)
|
||||
echo -e "\n${YEL}Option ${RED}$1${YEL} not recognized... Refer to help below!${CRS}"
|
||||
help
|
||||
exit ;;
|
||||
exit_clean ;;
|
||||
|
||||
esac
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue