You are not logged in.
I'm using aura for updating packages. I have written a script to do both in one go. With the flag -s given to the script the systems shuts down if everything succeeded, else it keeps running. In order to prevent laptops from going to sleep in between the commands are run with systemd-inhibit. I just wanted to share this and maybe get some hints if that can be simplified even?
$ cat /opt/scripts/myupdate.sh
#!/bin/bash
mdown=true # does nothing when invoked
[ "$1" == "-s" ] && mdown=mshut
mshut () {
/usr/bin/shutdown -h 3
}
run_update () {
/usr/bin/aura --noconfirm -Sy --needed archlinux-keyring &&
/usr/bin/aura --noconfirm -Su &&
/usr/bin/aura --noconfirm -Aua
}
export -f run_update
/usr/bin/systemd-inhibit /usr/bin/bash -c "run_update" && $mdownOffline
Wouldn't something like this do the job?
systemd-inhibit --whateverargs sh -c "paru -Syu && systemctl poweroff || notify-send --whatevertomakeiturgent 'update failed'"Then set this as a alias in your shell's .rc .
Last edited by jl2 (2025-10-20 12:32:53)
Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...
Offline
Thanks jl2.
These are actually two hints, one for simplifying the script and the other for paru.
I will check it out.
Offline