@@ -45,14 +45,18 @@ actualizarSistema() {
45
45
if [[ -f ' /usr/bin/npm' ]] || [[ -f " $HOME /.npm/bin/npm" ]]; then
46
46
echo " Actualizando desde NPM"
47
47
npm update -g
48
- fi
49
48
50
- if [[ -f ' /usr/bin/pip' ]] || [[ -f " $HOME /.local/bin/pip" ]]; then
51
- echo " Actualizando desde PIP Python 2"
52
- # pip-review --local --auto
53
- python2 -m pip_review --local --auto
49
+ if [[ -f " $HOME /.npm/bin/npm" ]]; then
50
+ npm install -g npm
51
+ fi
54
52
fi
55
53
54
+ # if [[ -f '/usr/bin/pip' ]] || [[ -f "$HOME/.local/bin/pip" ]]; then
55
+ # echo "Actualizando desde PIP Python 2"
56
+ # #pip-review --local --auto
57
+ # python2 -m pip_review --local --auto
58
+ # fi
59
+
56
60
if [[ -f ' /usr/bin/pip3' ]] || [[ -f " $HOME /.local/bin/pip3" ]]; then
57
61
echo " Actualizando desde PIP Python 3"
58
62
# py -3 -m pip_review --local --auto
@@ -67,6 +71,38 @@ actualizarSistema() {
67
71
if [[ " $DISTRO " = ' raspbian' ]]; then
68
72
sudo rpi-update
69
73
fi
74
+
75
+ # # Intenta actualizar hosts y hosts.deny
76
+ echo -e " $VE Configurar archivo$RO /etc/hosts$CL "
77
+
78
+ # # La primera vez se traslada a un archivo que se usará para local.
79
+ if [[ ! -f ' /etc/hosts.local' ]] && [[ -f ' /etc/hosts' ]]; then
80
+ sudo cp ' /etc/hosts' ' /etc/hosts.local'
81
+ fi
82
+
83
+ # # Crea copia del último archivo antes de actualizar
84
+ if [[ -f ' /etc/hosts' ]]; then
85
+ sudo mv ' /etc/hosts' ' /etc/hosts.BACKUP'
86
+ fi
87
+
88
+ if [[ ! -f ' /etc/hosts' ]]; then
89
+ sudo touch ' /etc/hosts'
90
+ fi
91
+
92
+ if [[ -f ' /etc/hosts.local' ]]; then
93
+ sudo cat ' /etc/hosts.local' | sudo tee " /etc/hosts"
94
+ else
95
+ echo -e " $VE Existe algún problema con el archivo$RO /etc/hosts.local$CL "
96
+ echo -e " $VE Te recomiendo revisar esto manualmente$CL "
97
+ fi
98
+
99
+ echo -e " $VE Descargando actualización de$RO Hosts Bloqueados$CL "
100
+ sudo wget https://hosts.ubuntu101.co.za/hosts -O ' /tmp/hosts' && sudo cat ' /tmp/hosts' | sudo tee -a ' /etc/hosts'
101
+
102
+ echo ' ' && echo ' '
103
+
104
+ echo -e " $VE Descargando actualización de$RO Hosts Denegados$CL "
105
+ sudo wget https://hosts.ubuntu101.co.za/superhosts.deny -O ' /etc/hosts.deny'
70
106
}
71
107
72
108
actualizarSistema
0 commit comments