diff options
author | David P <megver83@openmailbox.org> | 2017-09-29 14:18:19 -0300 |
---|---|---|
committer | David P <megver83@openmailbox.org> | 2017-09-29 14:18:19 -0300 |
commit | f5d62fdcd4a6d351fa25af3b3e443ba4de67a802 (patch) | |
tree | da3bb909024f145454fb7ff460931bbb8c4311af /configs/profile-openrc/root-image/etc/init.d/pacman-init | |
parent | 50a0dc41d6edbe36d081bcd0fab7d79f2a0d116a (diff) |
Added configs/profile-openrc
Diffstat (limited to 'configs/profile-openrc/root-image/etc/init.d/pacman-init')
-rwxr-xr-x | configs/profile-openrc/root-image/etc/init.d/pacman-init | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/configs/profile-openrc/root-image/etc/init.d/pacman-init b/configs/profile-openrc/root-image/etc/init.d/pacman-init new file mode 100755 index 0000000..ccc884c --- /dev/null +++ b/configs/profile-openrc/root-image/etc/init.d/pacman-init @@ -0,0 +1,30 @@ +#!/usr/bin/openrc-run +# Copyright (C) 2017 Parabola Project +# Copyright 2013-2017 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 "Starting Pacman keyring" + pacman-key --init &> /dev/null + pacman-key --populate archlinux parabola &> /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 +} |