aboutsummaryrefslogtreecommitdiffstats
path: root/main/nftables/nftables.post-upgrade
blob: cab85d0923d101ae196233f9112a7227d1c94e11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

ver_new="$1"
ver_old="$2"

# Copy rules file to the new default location, to be sure that we will
# not break existing installations.
if [ "$(apk version -t "$ver_old" "0.8.3-r1")" = "<" ]; then
	old_file='/var/lib/nftables/rules-save'
	new_file='/etc/nftables.nft'

	if [ -f "$old_file" ] && [ ! -f "$new_file" ]; then
		cp -a "$old_file" "$new_file"
	fi
fi