forked from vianney/arch-luks-suspend
-
Notifications
You must be signed in to change notification settings - Fork 9
/
install
32 lines (27 loc) · 1023 Bytes
/
install
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
post_install() {
echo '1) Enable the udev, encrypt, shutdown, and suspend hooks'
echo ' in /etc/mkinitcpio.conf and run `mkinitcpio -p linux`'
echo '2) Enable the go-luks-suspend service with:'
echo ' `systemctl enable go-luks-suspend.service`'
echo '3) Reboot'
}
post_upgrade() {
local newver="$1" oldver="$2"
if (("$(vercmp "$oldver" "1.2.0-1")" < 0)); then
echo '[ATTENTION] go-luks-suspend must now be explicitly enabled!'
echo '[ATTENTION] Run `systemctl enable go-luks-suspend.service` to enable it.'
fi
if (("$(vercmp "$oldver" "1.4.2-1")" < 0)); then
echo '[ATTENTION] Upgrading go-luks-suspend no longer requires a reboot unless indicated.'
fi
if [[ "$newver" != "$oldver" ]]; then
local src='/usr/lib/go-luks-suspend/initramfs-suspend'
local dst='/run/initramfs/suspend'
if [[ -e "$src" && -e "$dst" ]]; then
install -m755 "$src" "$dst"
else
echo '[ATTENTION] Reboot required to complete upgrade.'
fi
fi
}
# vim:set ft=sh ts=2 sw=2 et: