summarylogtreecommitdiffstats
path: root/gitea.install
blob: f4b47fee58f6aefeaf156ee069896bad41e3ee62 (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
pre_install() {
  if ! getent group gitea >/dev/null; then
    groupadd --system gitea
  fi
  if ! getent passwd gitea >/dev/null; then
    useradd -m --system -c 'gitea daemon user' -g gitea -s /bin/false gitea
  fi
  chsh gitea -s /bin/bash
}

post_install(){
	mkdir -p /var/log/gitea
	chown -R gitea:gitea /var/log/gitea
	chown -R gitea:gitea /var/lib/gitea
	systemctl daemon-reload
}

pre_upgrade(){
	pre_install $1
}

post_upgrade() {
	post_install $1
}

pre_remove() {
	systemctl stop gitea.service
	systemctl disable gitea.service
}

post_remove() {
  if getent passwd gitea >/dev/null; then
    userdel gitea
  fi
  if getent group gitea >/dev/null; then
    groupdel gitea
  fi
}