@@ -28,6 +28,10 @@ function update_script() {
2828 msg_error " No ${APP} Installation Found!"
2929 exit
3030 fi
31+ if ! [[ $( dpkg -s jq 2> /dev/null) ]]; then
32+ $STD apt-get update
33+ $STD apt-get install -y jq
34+ fi
3135
3236 update_available=$( curl -fsSL -X ' GET' " http://localhost:19200/api/status/update-available" -H ' accept: application/json' | jq .UpdateAvailable)
3337 if [[ " ${update_available} " == " true" ]]; then
@@ -37,22 +41,22 @@ function update_script() {
3741
3842 msg_info " Creating Backup"
3943 backup_filename=" /opt/${APP} _backup_$( date +%F) .tar.gz"
40- tar -czf $backup_filename -C /opt/fileflows Data
44+ tar -czf " $backup_filename " -C /opt/fileflows Data
4145 msg_ok " Backup Created"
4246
4347 msg_info " Updating $APP to latest version"
4448 temp_file=$( mktemp)
45- curl -fsSL https://fileflows.com/downloads/zip -o $temp_file
46- unzip -oq -d /opt/fileflows $temp_file
49+ curl -fsSL https://fileflows.com/downloads/zip -o " $temp_file "
50+ unzip -oq -d /opt/fileflows " $temp_file "
4751 msg_ok " Updated $APP to latest version"
4852
4953 msg_info " Starting $APP "
5054 systemctl start fileflows
5155 msg_ok " Started $APP "
5256
5357 msg_info " Cleaning Up"
54- rm -rf $temp_file
55- rm -rf $backup_filename
58+ rm -rf " $temp_file "
59+ rm -rf " $backup_filename "
5660 msg_ok " Cleanup Completed"
5761
5862 msg_ok " Update Successful"
@@ -70,4 +74,4 @@ description
7074msg_ok " Completed Successfully!\n"
7175echo -e " ${CREATING}${GN}${APP} setup has been successfully initialized!${CL} "
7276echo -e " ${INFO}${YW} Access it using the following URL:${CL} "
73- echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :19200${CL} "
77+ echo -e " ${TAB}${GATEWAY}${BGN} http://${IP} :19200${CL} "
0 commit comments