blob: 78f14060ca99a14cd571e23ba46284a9f04d2d27 (
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
|
post_install() {
systemctl daemon-reload
# Habilita e inicia o serviço
systemctl enable machctrl-backend.service 2>/dev/null || true
systemctl start machctrl-backend.service 2>/dev/null || true
# Verifica se realmente está enabled
if ! systemctl is-enabled machctrl-backend.service &>/dev/null; then
ln -sf /usr/lib/systemd/system/machctrl-backend.service /etc/systemd/system/multi-user.target.wants/machctrl-backend.service 2>/dev/null || true
fi
# Carrega módulo nct6775 para fans da placa-mãe
modprobe nct6775 2>/dev/null || true
if [ ! -f /etc/modules-load.d/nct6775.conf ]; then
echo "nct6775" > /etc/modules-load.d/nct6775.conf
fi
gtk-update-icon-cache /usr/share/icons/hicolor 2>/dev/null || true
update-desktop-database /usr/share/applications 2>/dev/null || true
echo ""
echo " ✅ MachCtrl instalado!"
echo " → Abrir: menu de apps ou terminal: machctrl"
echo " → Status: systemctl status machctrl-backend"
echo ""
}
post_upgrade() {
systemctl daemon-reload
systemctl restart machctrl-backend.service
# Garante módulo nct6775
modprobe nct6775 2>/dev/null || true
if [ ! -f /etc/modules-load.d/nct6775.conf ]; then
echo "nct6775" > /etc/modules-load.d/nct6775.conf
fi
gtk-update-icon-cache /usr/share/icons/hicolor 2>/dev/null || true
update-desktop-database /usr/share/applications 2>/dev/null || true
echo ""
echo " ✅ MachCtrl atualizado!"
echo ""
}
pre_remove() {
systemctl stop machctrl-backend.service 2>/dev/null || true
systemctl disable machctrl-backend.service 2>/dev/null || true
}
post_remove() {
systemctl daemon-reload
gtk-update-icon-cache /usr/share/icons/hicolor 2>/dev/null || true
update-desktop-database /usr/share/applications 2>/dev/null || true
echo ""
echo " MachCtrl removido."
echo " Configurações mantidas em: ~/.config/machctrl/"
echo " Para remover tudo: rm -rf ~/.config/machctrl"
echo ""
}
|