Skip to content

Commit d5190ed

Browse files
author
Marcus Funch
committed
Merge branch 'feature/54171_fix_upgrade_client_and_settings_script' into 'master'
Client upgrade and settings script: don't delete parameters.json for the... See merge request os2borgerpc/os2borgerpc-scripts!167
2 parents 695fa74 + 14d737a commit d5190ed

File tree

3 files changed

+27
-28
lines changed

3 files changed

+27
-28
lines changed

common/system/upgrade_client.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/bin/bash
1+
#!/usr/bin/env sh
22

3-
pip3 install --upgrade os2borgerpc-client
3+
set -ex
44

5+
pip3 install --upgrade os2borgerpc-client
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env sh
2+
3+
# Updates the OSborgerPC client and settings
4+
# Not relevant for new machines as they have saner defaults, but it's a good idea when upgrading older machines (machines instaled from images 3.1.0 (maybe even 3.1.1) or older)
5+
6+
set -ex
7+
8+
# IMPORTANT!: Remove old events identified, as this file may contain the same event duplicated many times in older clients.
9+
rm --force /etc/os2borgerpc/security/securityevent.csv
10+
11+
# Remove old parameters.json for all previous jobs (status is DONE or FAILED) as they may contain sensitive information
12+
for j in /var/lib/os2borgerpc/jobs/*; do
13+
if [ "$(cat "$j"/status)" = "DONE" ] || [ "$(cat "$j"/status)" = "FAILED" ]; then
14+
rm --force "$j/parameters.json"
15+
fi
16+
done
17+
18+
# Set the correct, more restrictive permissions on all previous jobs
19+
chmod --recursive 700 /var/lib/os2borgerpc
20+
21+
# More restrictive permissions on /home/superuser
22+
chmod -R 700 /home/superuser
23+
24+
pip3 install --upgrade os2borgerpc-client

common/system/upgrade_client_testing.sh

-26
This file was deleted.

0 commit comments

Comments
 (0)