aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/pacman-offline
blob: 3e9133b1c1e9f2cf378738e60da0675c2ccc72cc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

set -e

# verify this is for us or exit gracefully
if [ "$(readlink '/system-update')" != '/var/cache/pacman/pkg' ]; then
	exit 0
fi

# remove triggering symlink
rm -f /system-update

# install updates
if [ "$(pacman --sync  --print --needed archlinux-keyring | wc -l)" -gt 0 ]; then
	pacman --sync --noconfirm archlinux-keyring
fi
pacman --sync --noconfirm --sysupgrade

# clean up package cache
pacman --sync --noconfirm --clean

# reboot
systemctl reboot