python3-ascension.postinst (940B)
1 #!/bin/sh 2 # postinst script for ascension-bind 3 # 4 # see: dh_installdeb(1) 5 # load debconf library 6 set -e 7 8 if ! id ascension; then 9 adduser --system ascension 10 fi 11 # ok if this fails as gnunet is not yet a dependency 12 if ! id gnunet; then 13 addgroup --system gnunet 14 adduser ascension gnunet 15 fi 16 17 mkdir -p /etc/ascension.d/ 18 19 # add systemd unit file 20 cat > "/etc/ascension.d/gnunet-ascension.service" << EOF 21 [Unit] 22 Description=Starting GNUnet peer for ascension 23 After=network.target 24 25 [Service] 26 Type=oneshot 27 RemainAfterExit=yes 28 User=ascension 29 ExecStart=/usr/bin/gnunet-arm -s 30 ExecStop=/usr/bin/gnunet-arm -e 31 ExecReload=/usr/bin/gnunet-arm -r 32 33 [Install] 34 WantedBy=multi-user.target 35 EOF 36 37 # link the systemd unit file 38 ln -sf "/etc/ascension.d/gnunet-ascension.service" "/lib/systemd/system/gnunet-ascension.service" 39 40 # start and enable service 41 deb-systemd-invoke enable gnunet-ascension 42 deb-systemd-invoke start gnunet-ascension 43 44 #DEBHELPER#