summarylogtreecommitdiffstats
path: root/airvpn-suite.install
blob: cb5b10562ee6c76aa3b8cd067396b495551bf50b (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 passwd airvpn >/dev/null
    if [ $? -eq '2' ]; then
        useradd -Um airvpn
    fi
    chown -R airvpn:airvpn /etc/airvpn
    
    echo "#########################################################"
    echo "If you want to be able to execute goldcrest as your user,"
    echo "add yourself to the airvpn group, like this:"
    echo "sudo usermod -aG airvpn <username>"
    echo "#########################################################"
    
    # workaround for ExecStart path hardcoded in unit file
    # ln -s /usr/bin/bluetit /sbin/bluetit
    
    systemctl daemon-reload
    systemctl enable bluetit.service
    systemctl start bluetit.service
}

pre_upgrade() {
    systemctl stop bluetit.service
}

post_upgrade() {
    systemctl start bluetit.service
}

pre_remove() {
    systemctl stop bluetit.service
    systemctl disable bluetit.service
}

post_remove() {
    userdel -r airvpn 2>/dev/null
    getent group airvpn >/dev/null && gpasswd airvpn -M "" && groupdel airvpn
    # rm /sbin/bluetit
}