blob: 71e39e752f84fa13e6be106246c150def497a675 (
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
56
57
58
59
60
61
|
all_off="$(tput sgr0)"
bold="${all_off}$(tput bold)"
yellow="${bold}$(tput setaf 3)"
blue="${bold}$(tput setaf 4)"
green="${bold}$(tput setaf 2)"
_instructions() {
printf "${yellow}==>${all_off} ${bold}ATENTION:${all_off}
${blue}->${all_off} If you plan to use external client (e.g. amuleGUI or amuleweb) then you need to
provide ${bold}[ExternalConnect]${all_off} configuration.
${blue}->${all_off} You also need to specify amuleweb password.
Please follow ${bold}https://wiki.archlinux.org/index.php/AMule${all_off} for more information.
${blue}->${all_off} Service '${bold}amuled${all_off}' can be started as '${bold}systemctl start amuled${all_off}'.
${blue}->${all_off} Service '${bold}amuled${all_off}' (by user) can be started as '${bold}systemctl --user start amuled${all_off}'
${blue}->${all_off} Service '${bold}amulewebd${all_off}' can be started as '${bold}systemctl start amulewebd${all_off}'.\n"
}
_notice_if_amuled_exist() {
printf "${yellow}==>${all_off} ${bold}ATENTION:${all_off}
${green}==>${all_off} ${bold}Deprecated 'amuled' user/group found:${all_off}
${blue}->${all_off} The user/group '${bold}amuled${all_off}' has been deprecated.
${blue}->${all_off} New '${bold}amule${all_off}' user/group has been created instead.\n"
}
_instructions_if_amuled_exist() {
printf "${yellow}==>${all_off} ${bold}ATENTION:${all_off}
${blue}->${all_off} The new aMule data path is ${bold}/var/lib/amule${all_off}
Please move your old Amule data to new path with:
# ${bold}mv /var/lib/amuled/* /var/lib/amule${all_off}\n"
}
post_install() {
post_upgrade $1
_instructions
}
post_upgrade() {
if id -u amuled >/dev/null 2>&1; then
_notice_if_amuled_exist
fi
if [ -d /var/lib/amuled ]; then
_instructions_if_amuled_exist
fi
true
}
post_remove() {
paths=(/var/lib/amule /var/lib/amuled)
first=true
for path in ${paths[@]}; do
if [ -d $path ]; then
if $first; then
first=false
printf "${green}==>${all_off} ${bold}Leftover Paths:${all_off}\n"
fi
printf "${blue} -> ${all_off} ${bold}$path${all_off}\n"
fi
done
}
|