summarylogtreecommitdiffstats
path: root/nordvpn-git.install
blob: 84b26331b1fc959e6576aa121789a756add859c4 (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
40
post_install() {
  sudo groupadd nordvpn;
  echo ':: In order to enable nordvpn you have to start the following service:'
  echo '     sudo systemctl enable --now nordvpnd'
  echo ':: You have to add yourself to the nordvpn group:'
  echo "     sudo gpasswd -a USERNAME nordvpn"
  echo ':: You then have to restart for the group to be created:'
  echo "     reboot"
  #  remove some .dat files that might exist from nordvpn-bin
  #  https://github.com/NordSecurity/nordvpn-linux/issues/3#issuecomment-1551021304
  if [ -f "/var/lib/nordvpn/data/install.dat" ]; then
     echo "Removing /var/lib/nordvpn/data/install.dat";
     rm /var/lib/nordvpn/data/install.dat;
  fi;
  if [ -f "/var/lib/nordvpn/data/settings.dat" ]; then
     echo "Removing /var/lib/nordvpn/data/settings.dat";
     rm /var/lib/nordvpn/data/settings.dat;
  fi;
}

post_upgrade() {
  echo ':: In order to enable nordvpn you have to start the following service:'
  echo '     sudo systemctl enable --now nordvpnd'
  echo ':: You have to add yourself to the nordvpn group:'
  echo "     sudo gpasswd -a USERNAME nordvpn"
  echo ':: You then have to restart for the group to be created:'
  echo "     reboot"
}

pre_install() {
  chattr -i /var/lib/nordvpn/data/*
}

pre_upgrade() {
  chattr -i /var/lib/nordvpn/data/*
}

pre_remove() {
  chattr -i /var/lib/nordvpn/data/*
}