blob: 6f8f7ce640abaf518b344ec92bad5a98b3d7ebb4 (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
post_install() {
_mkuser
chown -R swaggereditor:swaggereditor /etc/swagger-editor /usr/share/swagger-editor
printf "%b\n" "$swaggereditor"
}
post_upgrade() {
post_install
}
post_remove() {
_rmuser
rm -rf /etc/swagger-editor /usr/share/swagger-editor
}
_mkuser() {
getent passwd swaggereditor &>/dev/null || {
echo -n "Creating swaggereditor user... "
grep -E "^swaggereditor:" /etc/group >/dev/null || groupadd swaggereditor
useradd -m -d /etc/swagger-editor -g swaggereditor -s /usr/bin/nologin swaggereditor
echo "done"
}
}
_rmuser() {
echo -n "Removing swaggereditor user... "
userdel -rf swaggereditor 2>/dev/null
echo "done"
}
read -d '' swaggereditor <<'EOF'
#####################################################################
#####################################################################
## ##
## Swagger Editor ##
## ______________ ##
## ##
## Swagger Editor lets you edit Swagger API specifications in ##
## YAML inside your browser and to preview documentations in ##
## real time. Valid Swagger JSON descriptions can then be ##
## generated and used with the full Swagger tooling (code ##
## generation, documentation, etc). ##
## ##
## Run the main application: ##
## ##
## # systemctl start swagger-editor ##
## ##
## Then open a browser and go to: ##
## ##
## http://127.0.0.1:9898 ##
## ##
## ##
#####################################################################
#####################################################################
EOF
|