summaryrefslogtreecommitdiff
path: root/configs/releng/root-image/etc/rc.d/pacman-init
blob: bbbd719e516bdc365090ea013636ce0b3ef6eb47 (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
32
33
34
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
	start)
		stat_busy "Initializing pacman keyring"
		if { pacman-key --init && pacman-key --populate archlinux; } &>/dev/null; then
			add_daemon pacman-init
			stat_done
		else
			stat_fail
			exit 1
		fi
		;;

	stop)
		stat_busy "Removing pacman keyring"
		rm -rf /etc/pacman.d/gnupg
		rm_daemon pacman-init
		stat_done
		;;

	restart)
		$0 stop
		$0 start
		;;

	*)
		echo "usage: $0 {start|stop|restart}"
esac

exit 0