summaryrefslogtreecommitdiffstats
path: root/abs/core/openssh/install
blob: 47c1e770ab0022b357b327465adb2b2b638e3e00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pre_upgrade() {
	# Remove socket activation. See: https://bugs.archlinux.org/task/62248
	if (( $(vercmp $2 8.0p1-3) < 0 )); then
	if systemctl is-enabled -q sshd.socket; then
		cat <<EOF
==> This package no longer provides sshd.socket and sshd@.service;
==> copies of those files will be placed under /etc/systemd/system
==> but please migrate to sshd.service whenever possible.
EOF
		src=/usr/lib/systemd/system
		dst=/etc/systemd/system
		for i in sshd.socket sshd\@.service; do
			if [[ ! -e "$dst/$i" ]]; then
				cp -v "$src/$i" "$dst/$i"
			fi
		done
		systemctl reenable sshd.socket
	fi
	fi
}

post_upgrade() {
	if (( $(vercmp $2 8.2p1-3) < 0 )); then
		if systemctl is-active sshd.service >/dev/null; then
			cat <<EOF
==> After this upgrade, your existing SSH daemon may be unable to accept
==> new connections. To fix this, your SSH daemon will now be restarted.
EOF
			systemctl restart sshd.service
		fi
	fi
}