summarylogtreecommitdiffstats
path: root/asf.install
blob: dcbc7358fff832b4dc764fca58e18d1d05a7471e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
post_install() {
    systemd-sysusers asf.conf
    chown -R asf: /var/lib/asf
}

post_upgrade() {
    post_install $1
    if [ "$(vercmp $2 2.1.3.1-2)" -lt 0 ] && [ grep -q "^asf:" /etc/passwd 2> /dev/null]; then
      usermod -s /bin/false -c "ArchiSteamFarm daemon" -d /var/lib/asf -g asf asf &> /dev/null
    fi
    if [ "$(vercmp $2 2.1.3.1-2)" -lt 0 ] && [ -d /opt/asf/config ]; then
      mv /opt/asf/config/ /var/lib/asf/
      mv /opt/asf/log.txt /var/lib/asf/

      chown -R asf: /var/lib/asf

      echo "# ASF config folder has been moved to /var/lib/asf"
      echo "# Consider this change when using /usr/bin/asf (e.g. 'asf --path=/var/lib/asf')"
    fi
}