Slackware 14.2 Pós-Instalação - Idioma, Teclado, Otimizações

Publicado por Mauricio Ferrari (última atualização em 07/05/2020)

[ Hits: 2.381 ]

Homepage: https://www.youtube.com/@LinuxDicasPro

Download slackware-pos-zero-bala

Download 1588734496.slackware-pos-zero-bala (versão 2)




Script que eu uso após a instalação do Slackware 14.2, mas deve servir para outras versões. Fiz questão de deixar o código bem organizado para fácil compreensão e deixei uma documentação bem no início do código para detalhar as modificações que o script fará, ficando ao seu critério comentar o que para você será inútil.

Essa primeira versão ainda está primitiva. Pretendo incrementar mais opções e talvez um menu interativo.

  



Versões atualizadas deste script

Versão 2 - Enviado por Mauricio Ferrari em 06/05/2020

Changelog: Estou já postando a versão 2.0 devido aos erros da primeira versão. Esse script agora executa o xorgsetup após as pós-configurações. O comando que o script cria foi melhorado literalmente e logo receberá novos comandos, inclusive alguns predefinidos do Linux Mint para o Slackware. O script também passa o pente fino nos serviços, deixando apenas o essencial para um usuário comum.

Download 1588734496.slackware-pos-zero-bala


Esconder código-fonte

#!/bin/bash

################################################################################################

 ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
 ###                                                             ###
 ### Slackware 14.2 - Pós Instalação - Zero Bala - Completo.     ###
 ###                                                             ###
 ### Versão 1.0 - 28/04/2020                                     ###
 ###                                                             ###
 ###                                                             ###
 ### By Mauricio Ferrari - Nova Trento - SC.                     ###
 ###                                                             ###
 ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###

################################################################################################

 ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
 ###                                                                                 ###
 ### Script que Facilita a Configuração do Slackware Após sua Instalação.            ###
 ###                                                                                 ###
 ###   Inclui:                                                                       ###
 ###                                                                                 ###
 ### - Configuração do Teclado ABNT2 - Modo Texto e Interface.                       ###
 ### - Configuração do Idioma para pt_BR.UTF-8.                                      ###
 ### - Configuração de Fonte com Acentos em Português.                               ###
 ### - Ativação do sudo.                                                             ###
 ### - Desativação dos Terminais 3, 4, 5 e 6.                                        ###
 ### - Ativação do Comando unicode_start para Exibição Correta do Caracteres ISO.    ###
 ### - Correção de dmesg para Funcionar como Usuário Comum.                          ###
 ### - Desativação de Notificação de E-mail do Sistema.                              ###
 ### - Inclusão dos Paths /usr/sbin e /sbin.                                         ###
 ###                                                                                 ###
 ###                                                                                 ###
 ###   Ajustes de Serviços:                                                          ###
 ###                                                                                 ###
 ### - Ativação do Serviço de Rede (Por Garantia).                                   ###
 ### - Ativação do Servidor de Impressão.                                            ###
 ### - Ativação do rc.local.                                                         ###
 ### - Desativação do Bluetooth.                                                     ###
 ###                                                                                 ###
 ###                                                                                 ###
 ###   Adicional:                                                                    ###
 ###                                                                                 ###
 ### - O Comando add-aliases é criado em /usr/bin para a adição de novos aliases.    ###
 ###                                                                                 ###
 ###                                                                                 ###
 ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###

################################################################################################


################################################################################################
#
#
# ### Verificar Usuário Root. ###

if [ "`id -u`" != 0 ]; then
   echo
   echo -e "\033[1;31mO Script deve ser executado como root !\033[0m"
   echo
   exit
fi


################################################################################################
#
#
# ### Configurar Teclado ABNT2 no Modo Texto. ###

if [ -e /etc/rc.d/rc.keymap ]; then
   rm /etc/rc.d/rc.keymap
fi

touch /etc/rc.d/rc.keymap
chmod 755 /etc/rc.d/rc.keymap

echo '#!/bin/sh
if [ -x /usr/bin/loadkeys ]; then
   /usr/bin/loadkeys br-abnt2.map
fi' | tee -a /etc/rc.d/rc.keymap


################################################################################################
#
#
# ### Configurar Teclado ABNT2 para a Interface via X Server. ###

if [ ! -e /etc/X11/xorg.conf.d/90-keyboard-layout.conf ]; then
   touch /etc/X11/xorg.conf.d/90-keyboard-layout.conf

echo 'Section "InputClass"
   Identifier "keyboard-all"
   MatchIsKeyboard "on"
   MatchDevicePath "/dev/input/event*"
   Driver "evdev"
   Option "XkbLayout" "br"
   Option "XkbVariant" "abnt2"
   Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection' | tee -a /etc/X11/xorg.conf.d/90-keyboard-layout.conf

fi


################################################################################################
#
#
# ### Ajustar Idioma para o Português do Brasil. ###

if [ -e /etc/profile.d/lang.sh -a -e /etc/profile.d/lang.csh ]; then
   rm /etc/profile.d/lang*
fi

touch /etc/profile.d/lang.sh
touch /etc/profile.d/lang.csh
chmod 755 /etc/profile.d/lang*

echo '#!/bin/sh
export LANG=pt_BR.UTF-8
export LC_ALL=pt_BR.UTF-8
export LINGUAS=pt_BR.UTF-8
export LC_CTYPE=pt_BR.UTF-8
export LANGUAGE=pt_BR.UTF-8
export LC_COLLATE=C' | tee -a /etc/profile.d/lang.sh

echo '#!/bin/csh
setenv LANG pt_BR.UTF-8
setenv LC_ALL pt_BR.UTF-8
setenv LINGUAS pt_BR.UTF-8
setenv LC_CTYPE pt_BR.UTF-8
setenv LANGUAGE pt_BR.UTF-8
setenv LC_LOCATE C' | tee -a /etc/profile.d/lang.csh


################################################################################################
#
#
# ### Trocar Fonte para uma Fonte com Acentos em Português. ###

if [ -e /etc/rc.d/rc.font ]; then
   rm /etc/rc.d/rc.font
fi

touch /etc/rc.d/rc.font
chmod 755 /etc/rc.d/rc.font

echo '#!/bin/sh
Setfont -v lat0-16.pstu.gz' | tee -a /etc/rc.d/rc.font


################################################################################################
#
#
# ### Habilitar sudo. ###

sed -i -e "s/# ALL ALL=(ALL) ALL/ALL ALL=(ALL) ALL/g" /etc/sudoers
sed -i -e "s/# %sudo   ALL=(ALL) ALL/%sudo ALL=(ALL) ALL/g" /etc/sudoers
sed -i -e "s/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g" /etc/sudoers
sed -i -e "s/# Defaults secure_path/Defaults secure_path/g" /etc/sudoers


################################################################################################
#
#
# ### Eliminar Terminais Inúteis. ###

sed -i -e "s/c3:12345:respawn:/#c3#:12345:respawn:/g" /etc/inittab
sed -i -e "s/c4:12345:respawn:/#c4#:12345:respawn:/g" /etc/inittab
sed -i -e "s/c5:12345:respawn:/#c5#:12345:respawn:/g" /etc/inittab
sed -i -e "s/c6:12345:respawn:/#c6#:12345:respawn:/g" /etc/inittab


################################################################################################
#
#
# ### Corrigir Bug do dmesg que não Funciona como Usuário Comum. ###

chmod +s /bin/dmesg


################################################################################################
#
#
# ### Ajustar Serviços. ###

chmod +x /etc/rc.d/rc.networkmanager
chmod +x /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.cups
chmod -x /etc/rc.d/rc.bluetooth


################################################################################################
#
#
# ### Comando para os Caracteres ISO serem Exibidos Corretamente. ###

if [ ! "`grep "unicode_start" /etc/rc.d/rc.local`" ]; then
   echo 'unicode_start' | tee -a /etc/rc.d/rc.local
fi


################################################################################################
#
#
# ### Remover Notificação de E-mail do Sistema e Demais Ajustes. ###

sed -i -e "s/MAIL_CHECK_ENAB      yes/MAIL_CHECK_ENAB       no/g" /etc/login.defs
sed -i -e "s/FAILLOG_ENAB      yes/FAILLOG_ENAB      no/g" /etc/login.defs
sed -i -e "s/#CREATE_HOME/CREATE_HOME/g" /etc/login.defs


################################################################################################
#
#
# ### Incluir Patchs Faltantes. ###

if [ ! "`grep "#add_path" /etc/profile`" ]; then

echo '#add_path
PATH=$PATH:/usr/sbin:/sbin' | tee -a /etc/profile

fi


################################################################################################
#
#
# ### Incluir Comando que Adiciona Novos Aliases. ###

if [ ! -e /usr/bin/add-aliases ]; then

touch /usr/bin/add-aliases
chmod 755 /usr/bin/add-aliases

echo '#!/bin/bash

if [ "`id -u`" != 0 ]; then
   LOCAL=/home/$USER
else
   LOCAL=/$USER
fi

if [ ! -e $LOCAL/.bashrc ]; then

echo AAA
# add-alias #
alias cp="cp -v"
alias mv="mv -v"
alias rm="rm -r"
alias df="df -Tha --total"
alias ls="ls --color=auto -F" 
alias search="find . -name"
alias mount="mount | column -t"
alias free="free -mt"
alias ren="mv"
alias cls="clear"
alias ipkg="installpkg"
alias upkg-n="upgradepkg --install-new"
alias upkg-r="upgradepkg --install-new --reinstall"
alias rpkg="removepkg"
alias spkg="ls /var/log/packages/ | grep"
alias desktop="xwmconfig"
alias services="ls -l /etc/rc.d"
alias rede="netconfig" AAA | tee -a $LOCAL/.bashrc

fi' | tee -a /usr/bin/add-aliases

sed -i -e "s/AAA/'/g" /usr/bin/add-aliases

fi

################################################################################################

Scripts recomendados

MURFEX (MUltiple Rar File EXtractor)

Removendo primeiras ou últimas linhas do arquivo

Automatizar scan e atualização com o ClamAV

Monitoramento de Tráfego de rede

Script para configurar Vivo 3G sem pppconfig e wvdial


  

Comentários
[1] Comentário enviado por maurixnovatrento em 28/04/2020 - 23:29h


Esqueci de especificar. O comando criado em /usr/bin o add-aliases deve der executado após sua criação como usuário comum e como root também. Não precisa de parâmetro nenhum.

[2] Comentário enviado por maurixnovatrento em 07/05/2020 - 21:59h


É altamente recomendado baixar a versão 2.0, o que tinha de erro foi corrigido.

___________________________________
Conhecimento não se Leva para o Túmulo.


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts