initial commit

This commit is contained in:
Ludovic Cartier
2024-11-08 16:14:46 +01:00
parent 79cc857a46
commit c7849945c3
5 changed files with 97 additions and 0 deletions

10
files/bash_completion Normal file
View File

@ -0,0 +1,10 @@
function _connect() {
COMPREPLY=()
local currentWord=${COMP_WORDS[COMP_CWORD]}
local completeHosts=$(cat /etc/passwd|grep "/var/www/sites"|cut -d ':' -f 1)
COMPREPLY=($(compgen -W "$completeHosts" -- "$currentWord"))
return 0
}
complete -F _connect groot

41
files/groot Normal file
View File

@ -0,0 +1,41 @@
#!/bin/bash
function _help() {
echo "\
.^. . _
/: ||\`\/ \~ ,
, [ & / \ y'
{v': \`\ / \`&~-,
'y. ' |\` . ' /
\ ' . , y
v . ' v
V .~. .~. V
: ( 0) ( 0) :
i \`'\` \`'\` j
i __ ,j
\`%\`~....~'&
<~o' / \\/\` \-s,
o.~'. )( r .o ,.
o', %\`\`\\/\`\`& : 'bF
d', ,ri.~~-~.ri , +h
\`oso' d\`~..~\`b 'sos\`
d\`+ II +\`b
i_:_yi_;_y I am groot! (C)"
echo
echo "No argument given !"
echo "Usage: groot <TAB>" >&2
echo
exit 1
}
function _connect() {
sudo su - $1 -s /bin/bash
}
if [ -z "$1" ]; then
_help
else
echo -e "\n\033[1;35mEntering $1 environment...\033[00m\n"
_connect $1
fi