Skip to content

Commit 2bb0ef0

Browse files
authored
Fix update dependencies (#3577)
1 parent 322043e commit 2bb0ef0

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

ct/fileflows.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
7074
msg_ok "Completed Successfully!\n"
7175
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
7276
echo -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}"

install/fileflows-install.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ update_os
1616

1717
msg_info "Installing Dependencies"
1818
$STD apt-get install -y \
19-
ffmpeg
19+
ffmpeg \
20+
jq
2021
msg_ok "Installed Dependencies"
2122

2223
read -r -p "Do you need the intel-media-va-driver-non-free driver for HW encoding (Debian 12 only)? <y/N> " prompt
@@ -53,8 +54,8 @@ msg_info "Setup ${APPLICATION}"
5354
$STD ln -svf /usr/bin/ffmpeg /usr/local/bin/ffmpeg
5455
$STD ln -svf /usr/bin/ffprobe /usr/local/bin/ffprobe
5556
temp_file=$(mktemp)
56-
curl -fsSL https://fileflows.com/downloads/zip -o $temp_file
57-
unzip -q -d /opt/fileflows $temp_file
57+
curl -fsSL https://fileflows.com/downloads/zip -o "$temp_file"
58+
unzip -q -d /opt/fileflows "$temp_file"
5859
(cd /opt/fileflows/Server && dotnet FileFlows.Server.dll --systemd install --root true)
5960
systemctl enable -q --now fileflows.service
6061
msg_ok "Setup ${APPLICATION}"
@@ -63,7 +64,7 @@ motd_ssh
6364
customize
6465

6566
msg_info "Cleaning up"
66-
rm -f $temp_file
67+
rm -f "$temp_file"
6768
$STD apt-get -y autoremove
6869
$STD apt-get -y autoclean
6970
msg_ok "Cleaned"

0 commit comments

Comments
 (0)