Prepared for more options

This commit is contained in:
Fr4nz D13trich 2025-12-21 14:28:13 +01:00
parent 7b2693a0df
commit f633a04f98

View file

@ -115,6 +115,19 @@ install_helium() {
done done
} }
### LAUNCHER
add_launcher() {
if ! [ -f "$INSTALL_PATH/helium-browser.AppImage" ] ; then
echo -e "\n ${RED}Helium AppImage not found! Can't add launcher...${CRS}"
exit 1
else
echo -e "\n ${RED}Not implemented yet...${CRS}"
exit 0
fi
}
### UPDATE ### UPDATE
update_helium() { update_helium() {
LOCAL_VERSION=$($INSTALL_PATH/helium-browser.AppImage --version | awk '{print $2}') LOCAL_VERSION=$($INSTALL_PATH/helium-browser.AppImage --version | awk '{print $2}')
@ -182,6 +195,19 @@ update_helium() {
} }
### AUTOMATIC UPDATE
auto_update() {
if ! [ -f "$INSTALL_PATH/helium-browser.AppImage" ] ; then
echo -e "\n ${RED}Helium AppImage not found! Can't add auto update script...${CRS}"
exit 1
else
echo -e "\n ${RED}Not implemented yet...${CRS}"
exit 0
fi
}
### REMOVE ### REMOVE
remove_helium() { remove_helium() {
if [ -d "$INSTALL_PATH" ] ; then if [ -d "$INSTALL_PATH" ] ; then
@ -219,7 +245,20 @@ script_version() {
} }
### COMPARE VERSION ### UPDATE SCRIPT
update_script() {
if ! [ -f "$INSTALL_PATH/helium-browser.AppImage" ] ; then
echo -e "\n ${RED}Helium AppImage not found! Can't update script...${CRS}"
exit 1
else
echo -e "\n ${RED}Not implemented yet...${CRS}"
exit 0
fi
}
### COMPARE APPIMAGE VERSION
compare_version() { compare_version() {
LOCAL_VERSION=$($INSTALL_PATH/helium-browser.AppImage --version | awk '{print $2}') LOCAL_VERSION=$($INSTALL_PATH/helium-browser.AppImage --version | awk '{print $2}')
@ -267,15 +306,16 @@ compare_version() {
help() { help() {
echo -e "\n${CYN}${SCRIPT_NAME}${CRS}\n" echo -e "\n${CYN}${SCRIPT_NAME}${CRS}\n"
echo -e "Helium Browser installer & updater script\n" echo -e "Helium Browser installer & updater script\n"
echo -e "Syntax: helium_helper.sh [ -i | -u | -r | -c | -s | -h ]\n" echo -e "Syntax: helium_helper.sh [ -i | -L | -u | -U | -r | -c | -s | -S | -h ]\n"
echo -e "Options:\n" echo -e "Options:\n"
echo -e "\t-i\tDownload & install Helium from GitHub" echo -e "\t-i\tDownload & install Helium from GitHub"
#echo -e "\t-L\tCreate desktop launcher" echo -e "\t-L\tCreate desktop launcher ${RED}--> Not yet working${CRS}"
echo -e "\t-u\tDownload & update Helium from GitHub" echo -e "\t-u\tDownload & update Helium from GitHub"
echo -e "\t-U\tEnable automatic updates on login ${RED}--> Not yet working${CRS}"
echo -e "\t-r\tRemove Helium" echo -e "\t-r\tRemove Helium"
echo -e "\t-c\tCompare local to remote version" echo -e "\t-c\tCompare local to remote version"
#echo -e "\t-S\tUpdate script"
echo -e "\t-s\tShow script version" echo -e "\t-s\tShow script version"
echo -e "\t-S\tUpdate script ${RED}--> Not yet working${CRS}"
echo -e "\t-h\tPrint this help page.\n" echo -e "\t-h\tPrint this help page.\n"
echo -e "Configured locations:\n" echo -e "Configured locations:\n"
echo -e "\t${GRN}${INSTALL_PATH}${CRS}\t\tInstall location" echo -e "\t${GRN}${INSTALL_PATH}${CRS}\t\tInstall location"
@ -291,7 +331,7 @@ clean_tmp() {
########## MAIN ########## ########## MAIN ##########
## GET OPTIONS ## GET OPTIONS
while getopts ":i,:u,:r,:c,:s,:h" OPTION ; do while getopts ":i,:L,:u,:U,:r,:c,:s,:S,:h" OPTION ; do
case $OPTION in case $OPTION in
i) i)
echo -e "\n ${YEL}Installing Helium Browser...${CRS}" echo -e "\n ${YEL}Installing Helium Browser...${CRS}"
@ -300,6 +340,13 @@ while getopts ":i,:u,:r,:c,:s,:h" OPTION ; do
clean_tmp clean_tmp
exit ;; exit ;;
L)
echo -e "\n ${YEL}Adding Helium Browser launcher...${CRS}"
dependency_check
add_launcher
#clean_tmp
exit ;;
u) u)
echo -e "\n ${YEL}Updating Helium Browser...${CRS}" echo -e "\n ${YEL}Updating Helium Browser...${CRS}"
dependency_check dependency_check