diff --git a/do.sh b/do.sh index e4efb12..dc8dcbf 100755 --- a/do.sh +++ b/do.sh @@ -7,8 +7,9 @@ ssh_clean () ssh_exec () { + login=$(git config user.name || echo $USER) export SSHPASS="${SSHPASS-Born2beRoot}" - ./ssh.exp -p 4242 ${USER}@127.0.0.1 $@ 2>&1 \ + ./ssh.exp -p 4242 ${login}@127.0.0.1 $@ 2>&1 \ | grep -v -i -e '^Warning: Permanently added' -e ' password:' -e '^spawn ssh' } diff --git a/sudo.sh b/sudo.sh index 7feb580..dc46d75 100755 --- a/sudo.sh +++ b/sudo.sh @@ -7,8 +7,9 @@ ssh_clean () ssh_sudo () { + login=$(git config user.name || echo $USER) export SSHPASS="${SSHPASS-Born2beRoot}" - ./ssh_sudo.exp -p 4242 ${USER}@127.0.0.1 sudo $@ 2>&1 \ + ./ssh_sudo.exp -p 4242 ${login}@127.0.0.1 sudo $@ 2>&1 \ | grep -v -i -e '^Warning: Permanently added' -e 'password' -e '^spawn ssh' -e 'Connection to' } diff --git a/test.sh b/test.sh index cf35a24..13b440e 100755 --- a/test.sh +++ b/test.sh @@ -38,7 +38,7 @@ main () read -r login if [ "${login}" == "" ] then - login=${USER-gbaconni} + login=$(git config user.name || echo $USER) fi echo -n "Password: " read -s pass