Revisión 6ae963d6
Añadido por Martin Nelbren Cuellar hace alrededor de 3 años
bin/enable/README.md | ||
---|---|---|
# Enable
|
||
# Enable
|
||
|
||
- :arrow_down: **curl**
|
||
|
||
```bash
|
||
# apt install -y curl
|
||
```
|
||
|
||
- :closed_lock_with_key: **sudo**
|
||
|
||
```bash
|
||
wget -qc https://raw.githubusercontent.com/nelbren/npres/master/bin/enable/sudo.bash && bash sudo.bash
|
||
# curl -sL https://raw.githubusercontent.com/nelbren/npres/master/bin/enable/sudo.bash | bash -
|
||
```
|
||
> **NOTA:** cerrar sesión y volver a abrir la sesión para que el cambio del grupo se refleje.
|
||
|
||
- :computer: **yafp**
|
||
|
||
```bash
|
||
wget -qc https://raw.githubusercontent.com/nelbren/npres/master/bin/enable/yafp.bash && bash yafp.bash
|
||
$ curl -sL https://raw.githubusercontent.com/nelbren/npres/master/bin/enable/yafp.bash | bash -
|
||
```
|
||
|
||
- :space_invader: **pimp**
|
||
```bash
|
||
wget -qc https://raw.githubusercontent.com/nelbren/npres/master/bin/enable/pimp.bash && bash pimp.bash
|
||
$ curl -sL https://raw.githubusercontent.com/nelbren/npres/master/bin/enable/pimp.bash | bash -
|
||
```
|
||
> **NOTA:** cerrar sesión y volver a abrir la sesión para que los cambios se reflejen.
|
bin/enable/pimp.bash | ||
---|---|---|
#
|
||
# pimp.bash
|
||
#
|
||
# v0.0.2 - 2021-02-27 - nelbren@nelbren.com
|
||
# v0.0.3 - 2021-03-16 - nelbren@nelbren.com
|
||
#
|
||
|
||
inform_task() {
|
||
... | ... | |
fi
|
||
}
|
||
|
||
locale_fix() {
|
||
inform_task "Locale fix?"
|
||
if [ "$LC_ALL" == "$LANG" ]; then
|
||
inform_and_exit 0 ""
|
||
else
|
||
inform_task "NO" 1
|
||
inform_task "Ok, no problem, i will try fix this" 2
|
||
sudo update-locale LC_ALL=$LANG
|
||
sudo locale-gen
|
||
echo -e "\nNOTE: Please close session and login again to get changes...\n"
|
||
fi
|
||
}
|
||
|
||
check_if_normal_user_running
|
||
sudo_test_access_to_user
|
||
misc_install_package
|
||
... | ... | |
npres_git_clone
|
||
cowsay_profile_install
|
||
colors_bashrc_enable
|
||
locale_fix
|
bin/enable/sudo.bash | ||
---|---|---|
#
|
||
# enable_sudo.bash
|
||
#
|
||
# v0.0.1 - 2021-02-23 - nelbren@nelbren.com
|
||
# v0.0.2 - 2021-03-16 - nelbren@nelbren.com
|
||
#
|
||
|
||
inform_task() {
|
||
... | ... | |
}
|
||
|
||
sudo_add_to_sudo_group() {
|
||
user=$(who am i | cut -d" " -f1)
|
||
#user=$(who am i | cut -d" " -f1)
|
||
user=$(w -h | grep -v root | cut -d" " -f1 | uniq)
|
||
inform_task "It is the turn to add the '$user' to the 'sudo' group"
|
||
if groups $user | grep -q sudo ; then
|
||
inform_and_exit 0 ""
|
||
... | ... | |
}
|
||
|
||
sudo_test_access_to_user() {
|
||
user=$(who am i | cut -d" " -f1)
|
||
#user=$(who am i | cut -d" " -f1)
|
||
user=$(w -h | grep -v root | cut -d" " -f1 | uniq)
|
||
inform_task "Let's test if the '$user' is in the sudo group"
|
||
if su $user -c groups | grep -q sudo ; then
|
||
inform_and_exit 0 ""
|
Exportar a: Unified diff
change from using wget to curl