archrelease: copy trunk to testing-x86_64
[arch-packages.git] / openssh / trunk / install
blob47c1e770ab0022b357b327465adb2b2b638e3e00
1 pre_upgrade() {
2         # Remove socket activation. See: https://bugs.archlinux.org/task/62248
3         if (( $(vercmp $2 8.0p1-3) < 0 )); then
4         if systemctl is-enabled -q sshd.socket; then
5                 cat <<EOF
6 ==> This package no longer provides sshd.socket and sshd@.service;
7 ==> copies of those files will be placed under /etc/systemd/system
8 ==> but please migrate to sshd.service whenever possible.
9 EOF
10                 src=/usr/lib/systemd/system
11                 dst=/etc/systemd/system
12                 for i in sshd.socket sshd\@.service; do
13                         if [[ ! -e "$dst/$i" ]]; then
14                                 cp -v "$src/$i" "$dst/$i"
15                         fi
16                 done
17                 systemctl reenable sshd.socket
18         fi
19         fi
22 post_upgrade() {
23         if (( $(vercmp $2 8.2p1-3) < 0 )); then
24                 if systemctl is-active sshd.service >/dev/null; then
25                         cat <<EOF
26 ==> After this upgrade, your existing SSH daemon may be unable to accept
27 ==> new connections. To fix this, your SSH daemon will now be restarted.
28 EOF
29                         systemctl restart sshd.service
30                 fi
31         fi