summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD24
-rw-r--r--fortune3
-rw-r--r--systemd.service5
-rw-r--r--systemd.timer8
5 files changed, 58 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c19647690a7d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = fotd
+ pkgdesc = Fortune of the day
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://git.exozy.me/exozyme/fotd
+ arch = any
+ license = GPL
+ conflicts = fortune-mod
+ backup = etc/fortune
+ backup = etc/motd.d/fortune
+ source = fortune
+ source = systemd.service
+ source = systemd.timer
+ sha256sums = 6cc31663003d7208c3b188e6529fe5b4933cefefa0a33a205ab12ca3400632a2
+ sha256sums = d220d733e08e57fe8d9c048a6deec88553034e36c1828dd778bda544e7b2202b
+ sha256sums = 91121ae4298f29502e9142006ccc4f95f0eef089e6e3aa6a7ccc6ff7651591c0
+
+pkgname = fotd
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..df758685af87
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,24 @@
+# Maintainer: Anthony Wang <a at exozy dot me>
+pkgname=fotd
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="Fortune of the day"
+arch=(any)
+url="https://git.exozy.me/exozyme/$pkgname"
+license=('GPL')
+conflicts=('fortune-mod')
+backup=('etc/fortune' 'etc/motd.d/fortune')
+source=("fortune"
+ "systemd.service"
+ "systemd.timer")
+sha256sums=('6cc31663003d7208c3b188e6529fe5b4933cefefa0a33a205ab12ca3400632a2'
+ 'd220d733e08e57fe8d9c048a6deec88553034e36c1828dd778bda544e7b2202b'
+ '91121ae4298f29502e9142006ccc4f95f0eef089e6e3aa6a7ccc6ff7651591c0')
+
+package() {
+ install -vDm755 fortune "$pkgdir/usr/bin/fortune"
+ install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+ install -vDm644 systemd.timer "$pkgdir/usr/lib/systemd/system/$pkgname.timer"
+ install -vDm644 /dev/null "$pkgdir/etc/fortune"
+ install -vDm644 /dev/null "$pkgdir/etc/motd.d/fortune"
+}
diff --git a/fortune b/fortune
new file mode 100644
index 000000000000..31cd2b7b3443
--- /dev/null
+++ b/fortune
@@ -0,0 +1,3 @@
+#!/usr/bin/bash
+
+shuf -n 1 /etc/fortune $@
diff --git a/systemd.service b/systemd.service
new file mode 100644
index 000000000000..3df67f1b8d1a
--- /dev/null
+++ b/systemd.service
@@ -0,0 +1,5 @@
+[Unit]
+Description=Randomly choose line from /etc/fortune to update /etc/motd.d/fortune
+
+[Service]
+ExecStart=sh -c "fortune > /etc/motd.d/fortune"
diff --git a/systemd.timer b/systemd.timer
new file mode 100644
index 000000000000..d00647b42b2c
--- /dev/null
+++ b/systemd.timer
@@ -0,0 +1,8 @@
+[Unit]
+Description=Update /etc/motd.d/fortune daily
+
+[Timer]
+OnCalendar=daily
+
+[Install]
+WantedBy=timers.target