summaryrefslogtreecommitdiff
path: root/social/diaspora-git/diaspora.install
blob: faf2cb78f6b700ac26eb38ca1b91e8968fc570c1 (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

dusr=diaspora
dhome=/usr/share/webapps/diaspora
dgems=/usr/share/webapps/diaspora-gems
dlog=/var/log/diaspora.log

post_install() {
  getent passwd $dusr &>/dev/null || useradd -r -d $dhome -s /bin/bash $dusr &>/dev/null
  chown -R $dusr:$dusr $dhome $dgems &>/dev/null
  [[ -f $dlog ]] && chown $dusr:$dusr $dlog
}

pre_upgrade(){
  etc/rc.d/diaspora stop &>/dev/null
  return 0
}

post_upgrade(){
  post_install $1
}

pre_remove(){
  pre_upgrade $1
}

post_remove(){
  getent passwd $dusr &>/dev/null && userdel -f $dusr
  return 0
}