Created
March 8, 2022 09:58
-
-
Save jcaesar/19654c8de537b895d5d7108438b90a0c to your computer and use it in GitHub Desktop.
pacoffman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euxo pipefail | |
kernelver="$(pacman -Qi linux-ec2 | grep Version)" | |
paccache -r | |
pacman -Syu --noconfirm | |
if test "$(( $(date +%s) / 86400 % 14 ))" -eq 0 || test "$(pacman -Qi linux-ec2 | grep Version)" != "$kernelver"; then | |
systemctl reboot | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Syu and reboot | |
[Service] | |
ExecStart=/usr/local/bin/maintain | |
Type=oneshot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Syu and reboot | |
[Timer] | |
OnCalendar=*-*-* 03:25:00 Asia/Tokyo | |
[Install] | |
WantedBy=timers.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Remove pacman db.lock on startup | |
[Timer] | |
OnBootSec=0s | |
[Install] | |
WantedBy=timers.target | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Remove pacman db.lock | |
[Service] | |
ExecStart=/usr/bin/rm -f /var/lib/pacman/db.lck | |
Type=oneshot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment