Skip to content

Commit 56b1501

Browse files
committed
Install 'network-config' and dont follow symlinks for backup
1 parent e890089 commit 56b1501

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
arch: ['src64']
15-
version: ['17.12', '18.6', '18.12', '19.6', 'latest']
15+
version: ['17.12', '18.6', '18.12', '19.6', '19.12', 'latest']
1616
ansible: ['1.8.4', '2.7']
1717

1818
steps:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 1.25.0 (2020-02-18)
4+
5+
* Install the 'network-config' file if it exists
6+
* Ensure backup tar doesn't follow symlinks
7+
38
## 1.24.0 (2019-10-31)
49

510
* Update JSON dependency to v4.1.0

roles/admin/templates/update_backup.sh.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Generic script for starting and stopping a backup
44
#
5-
# Copyright (c) 2013-2017 Alex Williams, Unscramble. See the LICENSE file (MIT).
5+
# Copyright (c) 2013-2020 Alex Williams, Unscramble. See the LICENSE file (MIT).
66
# https://unscramble.co.jp
77
#
88
# VERSION: {{ jidoteki_admin_version }}
@@ -53,14 +53,14 @@ start_backup() {
5353

5454
backup_all_files=$(cd $restore_path; find $backup_list -maxdepth 0 -print)
5555
disk_available=`/bin/df -k / | tail -n 1 | awk -F " " ' {print $4 }'`
56-
backup_size=$((`/bin/tar -C $restore_path -ch $backup_all_files -f - | wc -c` / 1024))
56+
backup_size=$((`/bin/tar -C $restore_path -c $backup_all_files -f - | wc -c` / 1024))
5757
backup_safeguard=$(($disk_available - 16384)) # 16 MiB in KiB
5858

5959
if [ "$backup_size" -lt "$backup_safeguard" ]; then
6060
echo "[`date +%s`][{{ admin_type }}] Starting backup" | log_output
6161

6262
# generate the backup archive
63-
/bin/tar -C "$restore_path" -chf "$backup_file" $backup_all_files || fail_and_exit
63+
/bin/tar -C "$restore_path" -cf "$backup_file" $backup_all_files || fail_and_exit
6464

6565
# generate the JSON status file
6666
filesize=`/usr/bin/du -ha $backup_file | awk '{print $1 }'`

roles/admin/templates/update_settings.sh.j2

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Generic script for updating the network and app settings
44
#
5-
# Copyright (c) 2013-2016 Alex Williams, Unscramble. See the LICENSE file (MIT).
5+
# Copyright (c) 2013-2020 Alex Williams, Unscramble. See the LICENSE file (MIT).
66
# https://unscramble.co.jp
77
#
88
# VERSION: {{ jidoteki_admin_version }}
@@ -47,6 +47,11 @@ move_settings_files() {
4747
mv -f network.conf /usr/local/etc/
4848
chmod 640 "/usr/local/etc/network.conf" ; chown 0:997 "/usr/local/etc/network.conf"
4949
fi
50+
51+
if [ -f "network-config" ]; then
52+
mv -f network-config /etc/sysconfig/network-config
53+
chmod 644 "/etc/sysconfig/network-config" ; chown 0:0 "/etc/sysconfig/network-config"
54+
fi
5055
}
5156

5257
save_network_settings() {

0 commit comments

Comments
 (0)