summaryrefslogtreecommitdiff
path: root/configs/lxde-openrc/airootfs/etc/init.d/pacman-init
diff options
context:
space:
mode:
Diffstat (limited to 'configs/lxde-openrc/airootfs/etc/init.d/pacman-init')
-rwxr-xr-xconfigs/lxde-openrc/airootfs/etc/init.d/pacman-init30
1 files changed, 30 insertions, 0 deletions
diff --git a/configs/lxde-openrc/airootfs/etc/init.d/pacman-init b/configs/lxde-openrc/airootfs/etc/init.d/pacman-init
new file mode 100755
index 0000000..b646e52
--- /dev/null
+++ b/configs/lxde-openrc/airootfs/etc/init.d/pacman-init
@@ -0,0 +1,30 @@
+#!/usr/bin/openrc-run
+# Copyright (C) 2018 Parabola Project
+# Copyright (C) Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Initializes Pacman keyring"
+
+depend() {
+ use haveged
+ after haveged
+}
+
+start() {
+ # Check that there's no keyring, if there isn't, create one
+ if [ ! -d /etc/pacman.d/gnupg ]; then
+ ebegin "Initializing Pacman keyring"
+ pacman-key --init &> /dev/null &&
+ pacman-key --populate ${KEYS} &> /dev/null
+ else
+ ebegin "Pacman keyring already started"
+ fi
+}
+
+stop() {
+ # If there's a keyring, delete it
+ if [ -d /etc/pacman.d/gnupg ]; then
+ ebegin "Stoping Pacman keyring"
+ rm -rf /etc/pacman.d/gnupg
+ fi
+}