#!/usr/bin/env bash # Cores CYAN='\033[0;36m' GREEN='\033[0;32m' YW='\033[0;33m' RED='\033[0;31m' NC='\033[0m' check-tsu() { clear if command -v tsu >/dev/null 2>&1; then echo -e "${YW} Removendo conflitos (tsu)..." apt remove tsu -y && apt autoremove -y fi } check_bashrc() { if [ ! -f "$HOME/.bashrc" ]; then echo "${RED} Arquivo .bashrc não encontrado. ${YW} Criando..." touch "$HOME/.bashrc" else echo "${GREEN} Arquivo .bashrc detectado." fi } check-tsu check_bashrc sed -i '/# --- Início Cyber-Root ---/,/# --- Fim Cyber-Root ---/d' ~/.bashrc >> /dev/null 2>&1 echo -e "${CYAN}[*] Configurando Ambiente Cyber-Root...${NC}" # Limpa aliases antigos de sudo para evitar conflitos if grep -q "alias sudo=" ~/.bashrc; then sed -i '/alias sudo=/d' ~/.bashrc fi # Adiciona as funções ao .bashrc se não existirem cat <<'EOF' >> ~/.bashrc # --- Início Cyber-Root --- # Funções para Shell Root e Sudo sudo() { su -c "PATH=$PATH; $@" } root() { local MY_PS1='\[\e[1;31m\]Cyber-Root\[\e[0m\]:\[\e[1;32m\]\w\[\e[0m\]# ' su -i -c "export PATH=$PATH; export HOME=$HOME; export TERM=$TERM; export PS1='$MY_PS1'; exec bash --norc --noprofile" } # --- Fim Cyber-Root --- EOF # Recarrega o .bashrc source ~/.bashrc echo -e "${GREEN}[+] Configuração concluída com sucesso!${NC}" echo -e "--------------------------------------" echo -e "${CYAN}sudo ${NC} - Executa comandos como root" echo -e "${CYAN}root${NC} - Entra no Shell Root interativo" echo -e "--------------------------------------"