-
Notifications
You must be signed in to change notification settings - Fork 0
/
e4rat-lite-git.install
59 lines (54 loc) · 1.72 KB
/
e4rat-lite-git.install
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
conf_file="/etc/e4rat-lite.conf"
sample_path="/usr/share/e4rat-lite/conf"
translate_msgs() {
if [ "${1}" == "pt" ]; then
msg_mandb="Atualizando índices, por favor aguarde..."
msg_usefull_1="\nÚtil:\n"
msg_usefull_2="${conf_file}"
msg_usefull_3="Arquivo de configuração.\n"
msg_usefull_4="Se você está usando o systemd, desabilite o"
msg_usefull_5="systemd-readahead-collect e o systemd-readahead-replay."
msg_usefull_6="A implementação do readahead conflita com o e4rat.\n"
installConfig_pt
else
msg_mandb="Updating indexes, please wait..."
msg_usefull_1="\nUsefull:\n"
msg_usefull_2="${conf_file}"
msg_usefull_3="Configuration file\n"
msg_usefull_4="If are you using systemd, disable the"
msg_usefull_5="systemd-readahead-collect and systemd-readahead-replay."
msg_usefull_6="readahead implementation conflicts with e4rat.\n"
installConfig_en
fi
}
post_install(){
echo "$msg_mandb"
mandb --quiet /usr/share/man/pt_BR
mandb --quiet /usr/share/man/en_US
echo -e "$msg_usefull_1"
echo "$msg_usefull_2"
echo -e "$msg_usefull_3"
echo "$msg_usefull_4"
echo "$msg_usefull_5"
echo -e "$msg_usefull_6"
}
post_upgrade(){
post_install
}
installConfig_pt() {
if [ -f "/etc/e4rat-lite.conf" ]; then
cp "${sample_path}/e4rat-lite.conf_pt_BR" "${conf_file}.new"
echo "Aviso: O novo arquivo de configuração foi instalado como ${conf_file}.new"
else
cp "${sample_path}/e4rat-lite.conf_pt_BR" "${conf_file}"
fi
}
installConfig_en() {
if [ -f "/etc/e4rat-lite.conf" ]; then
cp "${sample_path}/e4rat-lite.conf_en_US" "${conf_file}.new"
echo "Warning: The new configuration file was installed as ${conf_file}.new"
else
cp "${sample_path}/e4rat-lite.conf_en_US" "${conf_file}"
fi
}
translate_msgs "${LANG%%_*}"