summarylogtreecommitdiffstats
path: root/madsonic.install
blob: 61235e113d95fd886dca935af115344210c99b60 (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
post_install() {
  useradd -d /var/madsonic -MrU madsonic
  chown -R madsonic:madsonic /var/madsonic
  systemctl daemon-reload &> /dev/null
  echo "*************************************************"
  echo "* Edit /etc/madsonic.conf to configure madsonic *"
  echo "* Start with systemctl start madsonic.service   *"
  echo "*************************************************"
}

post_upgrade(){
  useradd -d /var/madsonic -MrU madsonic
  chown -R madsonic:madsonic /var/madsonic
  systemctl daemon-reload &> /dev/null
  echo -e "\033[31;1mIf upgrading from 5.1.5200 or earlier, and you have customized your madsonic.sh, you will need to manually replace \n\t\033[37m /var/madsonic/madsonic.sh \033[31m with \033[37m /var/madsonic/madsonic.sh.pacnew \033[31m \nfor /etc/madsonic.conf to be recognized.\033[0m"
  echo -e "\nMadsonic now runs under the \033[1mmadsonic\033[0m user. You may need to adjust the permissions of any external music directories to allow madsonic access.\n"

  systemctl is-active madsonic.service >/dev/null && systemctl restart madsonic.service
  
}

pre_remove(){
  systemctl stop madsonic
}

post_remove(){
  userdel madsonic
}