From f212c9ef2c9479824308b3a5378e508d13020b46 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 22 Sep 2017 00:36:39 +0200 Subject: initial commit --- systemd/pacman-offline | 17 +++++++++++++++++ systemd/pacman-offline.service | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 systemd/pacman-offline create mode 100644 systemd/pacman-offline.service (limited to 'systemd') diff --git a/systemd/pacman-offline b/systemd/pacman-offline new file mode 100755 index 0000000..9764666 --- /dev/null +++ b/systemd/pacman-offline @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +# verify this is for us or exit gracefully +if [ "$(readlink '/system-update')" != '/var/cache/pacman/pkg' ]; then + exit 0 +fi + +# install updates +pacman -Su --noconfirm + +# remove triggering symlink +rm -f /system-update + +# reboot +systemctl reboot diff --git a/systemd/pacman-offline.service b/systemd/pacman-offline.service new file mode 100644 index 0000000..3b698a3 --- /dev/null +++ b/systemd/pacman-offline.service @@ -0,0 +1,14 @@ +[Unit] +Description=Offline system update with pacman +ConditionPathExists=/system-update +DefaultDependencies=false +Requires=sysinit.target dbus.socket +After=sysinit.target dbus.socket +Before=shutdown.target system-update.target +OnFailure=reboot.target + +[Service] +Type=oneshot +StandardOutput=tty +StandardError=tty +ExecStart=/usr/lib/systemd/scripts/pacman-offline -- cgit v1.2.3-54-g00ecf