summarylogtreecommitdiffstats
path: root/oscam.install
blob: 30cc782e0889fc6a64d3961ec2f4da9eb5609ce2 (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
post_install() {
  systemd-sysusers

  if [ ! -f /var/lib/oscam/oscam.conf ]; then
    mkdir -p /var/lib/oscam
    cat <<'EOF' > /var/lib/oscam/oscam.conf
[global]
logfile                       = syslog

[webif]
httpport                      = 8080
httpuser                      = myusername
httppwd                       = mypassword
httpallowed                   = 0.0.0.0-255.255.255.255
EOF
    chown -R oscam:oscam /var/lib/oscam
    echo "Default username: myusername"
    echo "Default password: mypassword"
    echo "Default webinterface port: 8080"
    echo "WARNING! Webinterface is accessible for all IPs by default. Change that!"
  fi
}

post_upgrade() {
  systemd-sysusers

  if [ ! -f /var/lib/oscam/oscam.conf ]; then
    mv /var/lib/oscam/oscam.conf.pacsave \
      /var/lib/oscam/oscam.conf 2> /dev/null
  fi
}