aboutsummaryrefslogtreecommitdiff
path: root/contrib/packages/alpine/gnunet/gnunet.post-install
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-10-24 10:22:49 +0000
committerng0 <ng0@n0.is>2019-10-24 10:22:49 +0000
commitdf3eda06c84b86939956d64fca7aedc5deeb5ecb (patch)
treeaa5461b4d8c7da1d4a3d50be25f1dc130c0a937e /contrib/packages/alpine/gnunet/gnunet.post-install
parent7bacf9e51edaa9ccb30a4e13b45df9931ea4256d (diff)
downloadgnunet-df3eda06c84b86939956d64fca7aedc5deeb5ecb.tar.gz
gnunet-df3eda06c84b86939956d64fca7aedc5deeb5ecb.zip
move contrib/alpine to contrib/packages/alpine
Diffstat (limited to 'contrib/packages/alpine/gnunet/gnunet.post-install')
-rw-r--r--contrib/packages/alpine/gnunet/gnunet.post-install40
1 files changed, 40 insertions, 0 deletions
diff --git a/contrib/packages/alpine/gnunet/gnunet.post-install b/contrib/packages/alpine/gnunet/gnunet.post-install
new file mode 100644
index 000000000..f7c19b26f
--- /dev/null
+++ b/contrib/packages/alpine/gnunet/gnunet.post-install
@@ -0,0 +1,40 @@
1#!/bin/sh
2
3# Enumerate users.
4users=`awk -F ':' '$3>=1000 && $3<2000 {print $1}' /etc/passwd`
5
6# Install gnunet.conf for existing users.
7for user in $users; do
8 install -m644 -o $user -g $user -D /etc/skel/.config/gnunet.conf \
9 /home/$user/.config/gnunet.conf
10done
11
12# Enable GNS proxy for users, if desired.
13echo "Use GNU Name System in Firefox/Chromium by default? [y,N]"
14read -r yn
15case $yn in
16y|Y )
17 # Enable GNS proxy for existant users.
18 for user in $users; do
19 port=$((8000+$(id -u $user)))
20 gnunet-config -c /home/$user/.config/gnunet.conf \
21 --rewrite \
22 --section=gns-proxy \
23 --option=IMMEDIATE_START \
24 --value=YES
25 gnunet-config -c /home/$user/.config/gnunet.conf \
26 --rewrite \
27 --section=gns-proxy \
28 --option=OPTIONS \
29 --value="-p $port"
30 done
31
32 # Enable GNS proxy for future users.
33 echo "[gns-proxy]" >> /etc/skel/.config/gnunet.conf
34 echo "IMMEDIATE_START = YES" >> /etc/skel/.config/gnunet.conf
35 ;;
36* )
37 ;;
38esac
39
40exit 0