tawasuyu

tawasuyu/brahman

Rust 212TOML 64JSON 13HTML 12666 Definiciones

⎇ 1fdbd358c8cd914fb767cbee1483d79935aa1fec scripts/uninstall-arje.sh Shell · 47 líneas · 1.6 KB Historia crudo

fix(scripts): Fedora/RHEL usan /boot/grub2/grub.cfg, no el wrapper EFI 5edd8de91 · sergio ·

1#!/usr/bin/env bash
2# uninstall-arje.sh — revierte lo que install-arje-as-init.sh hizo.
3#
4# - Borra /usr/sbin/arje-* y /usr/bin/{brahman-status,busctl,brainctl}.
5# - Borra el bloque ARJE-MENUENTRY de /etc/grub.d/40_custom.
6# - Regenera grub.cfg.
7# - NO toca /ente/seed.card.json (querés conservar customización).
8# - NO toca /sbin/init ni systemd.
9
10set -euo pipefail
11
12if [ "$(id -u)" -ne 0 ]; then
13  echo "[uninstall-arje] hace falta root" >&2
14  exit 1
15fi
16
17echo "[uninstall-arje] removiendo binarios"
18rm -f /usr/sbin/arje-zero
19for b in arje-echo arje-policy-provider \
20         arje-logind-compat arje-hostnamed-compat arje-timedated-compat \
21         arje-localed-compat arje-journald-compat arje-resolved-compat \
22         arje-polkit-compat arje-machined-compat arje-systemd1-compat \
23         arje-notify-compat arje-timer-compat arje-tmpfiles-compat \
24         arje-binfmt-compat; do
25  rm -f "/usr/sbin/$b"
26done
27for e in brahman-status busctl brainctl; do
28  rm -f "/usr/bin/$e"
29done
30
31echo "[uninstall-arje] limpiando menuentry de /etc/grub.d/40_custom"
32CUSTOM=/etc/grub.d/40_custom
33if [ -f "$CUSTOM" ] && grep -q "BEGIN ARJE-MENUENTRY" "$CUSTOM"; then
34  awk '/BEGIN ARJE-MENUENTRY/{f=1} /END ARJE-MENUENTRY/{f=0; next} !f' "$CUSTOM" \
35    > "$CUSTOM.tmp" && mv "$CUSTOM.tmp" "$CUSTOM"
36  chmod 0755 "$CUSTOM"
37fi
38
39if command -v update-grub >/dev/null 2>&1; then
40  update-grub
41elif command -v grub2-mkconfig >/dev/null 2>&1; then
42  grub2-mkconfig -o /boot/grub2/grub.cfg
43elif command -v grub-mkconfig >/dev/null 2>&1; then
44  grub-mkconfig -o /boot/grub/grub.cfg
45fi
46
47echo "[uninstall-arje] hecho. /ente/seed.card.json conservado (borralo a mano si querés)."