]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | ||
3 | set -e | |
4 | ||
5 | #DEBHELPER# | |
6 | ||
7 | case "$1" in | |
8 | configure) | |
9 | if test -n "$2"; then | |
10 | ||
11 | # TODO: remove once PVE 8.0 is released | |
12 | if dpkg --compare-versions "$2" 'lt' '7.0-3'; then | |
13 | warning="Warning: failed to move old CIFS credential file, cluster not quorate?" | |
14 | for file in /etc/pve/priv/*.cred; do | |
15 | if [ -f "$file" ]; then | |
16 | echo "Info: found CIFS credentials using old path: $file" >&2 | |
17 | mkdir -p "/etc/pve/priv/storage" || { echo "$warning" && continue; } | |
18 | base=$(basename --suffix=".cred" "$file") | |
19 | target="/etc/pve/priv/storage/$base.pw" | |
20 | if [ -f "$target" ]; then | |
21 | if diff "$file" "$target" >&2 > /dev/null; then | |
22 | echo "Info: removing $file, because it is identical to $target" >&2 | |
23 | rm "$file" || { echo "$warning" && continue; } | |
24 | else | |
25 | echo "Warning: not renaming $file, because $target already exists and differs!" >&2 | |
26 | fi | |
27 | else | |
28 | echo "Info: renaming $file to $target" >&2 | |
29 | mv "$file" "$target" || { echo "$warning" && continue; } | |
30 | fi | |
31 | fi | |
32 | done | |
33 | fi | |
34 | fi | |
35 | ;; | |
36 | ||
37 | esac | |
38 | ||
39 | exit 0 |