summarylogtreecommitdiffstats
path: root/icecream.install
blob: 5f33f85ec696033c279ba41513216606e8f1ae00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
post_install() {
    getent group icecream &>/dev/null || groupadd -r icecream >/dev/null
    getent passwd icecream &>/dev/null || useradd -r -g icecream -s /bin/false \
	    -c "Icecream Daemon" -d /var/cache/icecream icecream 2>/dev/null
    mkdir -p /var/cache/icecream
    mkdir -p /var/log/icecream
    touch /var/log/icecream/scheduler
    touch /var/log/icecream/iceccd
    chown -R icecream:icecream /var/cache/icecream /var/log/icecream/scheduler /var/log/icecream/iceccd
    echo ""
    echo "If you use a firewall, you need to open the following ports:"
    echo "    * 10245/tcp"
    echo "    * 8765/tcp"
    echo "    * 8766/tcp"
    echo ""
    echo "If your scheduler is running on another machine, you also need a special rule to allow broadcasts:"
    echo "    * source network: 0/0"
    echo "    * source port: 8765/udp"
    echo ""
    echo "UFW Example: "
    echo "* sudo ufw allow proto tcp from any to any port 10245"
    echo "* sudo ufw allow proto tcp from any to any port 8765"
    echo "* sudo ufw allow proto tcp from any to any port 8766"
    echo "* sudo ufw allow proto udp from any to any port 8765"
    echo "* sudo ufw allow proto udp from any port 8765 to any"
    echo ""
    echo "See https://github.com/icecc/icecream#firewall for further information."
    echo ""
}

post_upgrade() {
    post_install
}

post_remove() {
    getent passwd icecream &>/dev/null && userdel icecream >/dev/null
    getent group icecream &>/dev/null && groupdel icecream >/dev/null
    true
}