initial commit
This commit is contained in:
10
files/bash_completion
Normal file
10
files/bash_completion
Normal 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
41
files/groot
Normal 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
|
||||
|
Reference in New Issue
Block a user