summaryrefslogtreecommitdiff
path: root/configs/lxde-openrc/root-image/etc/init.d/pacman-init
blob: b6106833f03ce6fe4644a33d3f6885d6984ea121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/openrc-run
# Copyright (C) 2017 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
    # in the background for a faster boot
    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
}