aboutsummaryrefslogtreecommitdiff
path: root/contrib/packages/arch/gnunet/gnunet.install
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/packages/arch/gnunet/gnunet.install')
-rw-r--r--contrib/packages/arch/gnunet/gnunet.install54
1 files changed, 54 insertions, 0 deletions
diff --git a/contrib/packages/arch/gnunet/gnunet.install b/contrib/packages/arch/gnunet/gnunet.install
new file mode 100644
index 000000000..2560926d8
--- /dev/null
+++ b/contrib/packages/arch/gnunet/gnunet.install
@@ -0,0 +1,54 @@
1post_install() {
2
3 local _PWD_PAIRS_="$(awk -F ':' '$3>=1000 && $3<2000 {print $1":"$6}' '/etc/passwd')"
4 local _USER_
5 local _GROUP_
6 local _CFG_DIR_
7
8 for _PWD_PAIR_ in ${_PWD_PAIRS_}; do
9 _USER_="$(echo $_PWD_PAIR_ | cut -d ':' -f 1)"
10 _GROUP_="$(id -gn "${_USER_}")"
11 _CFG_DIR_="$(echo $_PWD_PAIR_ | cut -d ':' -f 2)/.config"
12 test -e "${_CFG_DIR_}/gnunet.conf" || (install -dm700 -o \
13 "${_USER_}" -g "${_GROUP_}" "${_CFG_DIR_}" && install \
14 -Dm600 -o "${_USER_}" -g "${_GROUP_}" \
15 '/etc/skel/.config/gnunet.conf' \
16 "${_CFG_DIR_}/gnunet.conf")
17 done
18
19 echo
20 echo 'Do not forget to add your user to the `gnunet` group, with'
21 echo
22 echo ' sudo usermod -aG gnunet "$(whoami)"'
23 echo
24 echo 'If later you want to remove your user from the group, launch'
25 echo
26 echo ' sudo gpasswd --delete "$(whoami)" gnunet'
27 echo
28 echo 'For information on how to use GNUnet plaese refer to the GNUnet article in the'
29 echo 'ArchWiki (https://wiki.archlinux.org/title/GNUnet).'
30 echo
31
32}
33
34post_remove() {
35
36 echo
37 echo 'The home directory of the `gnunet` user (`/var/lib/gnunet/`) is left after'
38 echo 'uninstalling GNUnet. If you are sure that you are never going to use GNUnet'
39 echo 'ever again, launch:'
40 echo
41 echo ' for username in $(getent group gnunet | cut -d: -f4 | tr '\'','\'' '\'' '\''); do \'
42 echo ' sudo gpasswd --delete "${username}" gnunet; done'
43 echo ' sudo userdel -r gnunet'
44 echo ' sudo groupdel gnunetdns'
45 echo
46 echo '**Warning** The identity and all the information about the network'
47 echo 'cumulatively stored by the current peer will be destroyed - this will not'
48 echo 'affect files explicitly downloaded in other paths.'
49 echo
50 echo 'For further information plaese refer to the GNUnet article in the ArchWiki'
51 echo '(https://wiki.archlinux.org/title/GNUnet).'
52 echo
53
54}