Debian Codegraph @

debian/distributed-net.postinst

raw
1 #!/bin/sh
2
3 # exit if any errors occur
4 set -e
5
6 # Load debconf
7 . /usr/share/debconf/confmodule
8
9 # Configure the distributed.net client
10 db_get distributed-net/fullconfig
11 if [ $RET = "true" ]; then
12 db_stop
13
14 touch /etc/distributed-net.conf
15 chown daemon:daemon /etc/distributed-net.conf
16
17 cd /var/lib/distributed-net
18
19 # Redirecting SDTIN from /dev/tty to workaroung bug #142944
20 su daemon -s /bin/sh -c "/usr/bin/dnetc -ini /etc/distributed-net.conf -inbase /var/lib/distributed-net/buff-in -outbase /var/lib/distributed-net/buff-out -config" < /dev/tty
21 fi
22
23 # Set the ownership on the buffers.
24 chown daemon:daemon /var/lib/distributed-net/* 2>/dev/null || true
25 chown daemon:daemon /var/lib/distributed-net 2>/dev/null || true
26
27 # Create the log file initially.
28 touch /var/log/distributed-net.log
29 chown daemon:adm /var/log/distributed-net.log
30 chmod 640 /var/log/distributed-net.log
31
32 #DEBHELPER#