Revisión ebcb34ac
Añadido por Martin Cuellar hace más de 2 años
bin/enable/sudo.bash | ||
---|---|---|
#
|
||
# enable_sudo.bash
|
||
#
|
||
# v0.0.2 - 2021-03-16 - nelbren@nelbren.com
|
||
# v0.0.3 - 2021-08-25 - nelbren@nelbren.com
|
||
#
|
||
|
||
inform_task() {
|
||
... | ... | |
inform_and_exit $? "Problem disassibling password!"
|
||
}
|
||
|
||
get_user() {
|
||
echo $(users | tr "[ ]" "[\n]" | uniq | tail -1)
|
||
}
|
||
|
||
sudo_add_to_sudo_group() {
|
||
#user=$(who am i | cut -d" " -f1)
|
||
user=$(w -h | grep -v root | cut -d" " -f1 | uniq)
|
||
#user=$(w -h | grep -v root | cut -d" " -f1 | uniq)
|
||
user=$(get_user)
|
||
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=$(w -h | grep -v root | cut -d" " -f1 | uniq)
|
||
#user=$(w -h | grep -v root | cut -d" " -f1 | uniq)
|
||
user=$(get_user)
|
||
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
super_tiny_colors.py and fix large username in sudo.bash