]>
Commit | Line | Data |
---|---|---|
8639f6be FG |
1 | #!/bin/bash |
2 | ||
11d30909 | 3 | # abort if any command returns an error value |
8639f6be FG |
4 | set -e |
5 | ||
6 | # handle incorrectly installed sysctl.d snippet (pve-cluster 5.0-16 and -17) | |
7 | # TODO: remove in PVE 6.0 | |
8 | function sysctlcleanup { | |
9 | if test -z "$1"; then | |
10 | # no old version, nothing to do | |
11 | true | |
12 | else | |
13 | if dpkg --compare-versions "$1" '<=' '5.0-17'; then | |
14 | # remove directory if it exists | |
15 | # otherwise we can't install our actual pve.conf file | |
16 | if test -d '/etc/sysctl.d/pve.conf'; then | |
17 | rm -rf '/etc/sysctl.d/pve.conf' | |
18 | fi | |
19 | fi | |
20 | fi | |
21 | } | |
22 | ||
23 | case "$1" in | |
24 | upgrade) | |
25 | sysctlcleanup "$2" | |
26 | ;; | |
27 | ||
28 | install) | |
29 | sysctlcleanup "$2" | |
30 | ;; | |
31 | ||
32 | esac | |
33 | ||
34 | #DEBHELPER# |