summarylogtreecommitdiffstats
path: root/curly-turtle.install
blob: f77c13e422387c73888e790f35de85da921f9d7d (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
# Colored makepkg-like functions
all_off="$(tput sgr0)"
bold="${all_off}$(tput bold)"
blue="${bold}$(tput setaf 4)"
yellow="${bold}$(tput setaf 3)"

msg_blue() {
    printf "${blue}==>${bold} $1${all_off}\n"
}

note() {
    printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
}

pre_install() {
    _update
}

_update() {
    if ! getent passwd curly-turtle &>/dev/null; then
        msg_blue "Adding user 'curly-turtle'"
        useradd -m -r -U -d /usr/lib/node_modules/curly-turtle -s /bin/false curly-turtle &>/dev/null
    fi
    chown -R curly-turtle:curly-turtle /usr/lib/node_modules/curly-turtle
}

post_install() {
    _update
    note "Before run curly-turtle, follow https://github.com/FiveYellowMice/curly-turtle to create a config file ."
    note "And follow https://github.com/FiveYellowMice/curly-turtle/wiki/Daemon to start it ."
    
}

post_upgrade() {
    _update
}

post_remove() {
    if getent passwd curly-turtle &>/dev/null; then
        msg_blue "Removing user 'curly-turtle'"
        userdel -rf curly-turtle &>/dev/null
    fi
}