ascension

Migrate DNS zones to the GNU Name System
Log | Files | Refs | README | LICENSE

python3-ascension.postinst (874B)


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