mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-09-21 02:17:11 +00:00
style(plugins/{progress,vagrant}): adjust indentation
This commit is contained in:
parent
e78373c9f7
commit
fc969116e2
@ -23,7 +23,7 @@
|
||||
#
|
||||
function delay()
|
||||
{
|
||||
sleep 0.2;
|
||||
sleep 0.2;
|
||||
}
|
||||
|
||||
#
|
||||
@ -32,29 +32,29 @@ function delay()
|
||||
CURRENT_PROGRESS=0
|
||||
function progress()
|
||||
{
|
||||
PARAM_PROGRESS=$1;
|
||||
PARAM_STATUS=$2;
|
||||
PARAM_PROGRESS=$1;
|
||||
PARAM_STATUS=$2;
|
||||
|
||||
if [ $CURRENT_PROGRESS -le 0 -a $PARAM_PROGRESS -ge 0 ] ; then echo -ne "[..........................] (0%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 5 -a $PARAM_PROGRESS -ge 5 ] ; then echo -ne "[#.........................] (5%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 10 -a $PARAM_PROGRESS -ge 10 ]; then echo -ne "[##........................] (10%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 15 -a $PARAM_PROGRESS -ge 15 ]; then echo -ne "[###.......................] (15%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 20 -a $PARAM_PROGRESS -ge 20 ]; then echo -ne "[####......................] (20%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 25 -a $PARAM_PROGRESS -ge 25 ]; then echo -ne "[#####.....................] (25%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 30 -a $PARAM_PROGRESS -ge 30 ]; then echo -ne "[######....................] (30%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 35 -a $PARAM_PROGRESS -ge 35 ]; then echo -ne "[#######...................] (35%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 40 -a $PARAM_PROGRESS -ge 40 ]; then echo -ne "[########..................] (40%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 45 -a $PARAM_PROGRESS -ge 45 ]; then echo -ne "[#########.................] (45%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 50 -a $PARAM_PROGRESS -ge 50 ]; then echo -ne "[##########................] (50%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 55 -a $PARAM_PROGRESS -ge 55 ]; then echo -ne "[###########...............] (55%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 60 -a $PARAM_PROGRESS -ge 60 ]; then echo -ne "[############..............] (60%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 65 -a $PARAM_PROGRESS -ge 65 ]; then echo -ne "[#############.............] (65%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 70 -a $PARAM_PROGRESS -ge 70 ]; then echo -ne "[###############...........] (70%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 75 -a $PARAM_PROGRESS -ge 75 ]; then echo -ne "[#################.........] (75%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 80 -a $PARAM_PROGRESS -ge 80 ]; then echo -ne "[####################......] (80%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 85 -a $PARAM_PROGRESS -ge 85 ]; then echo -ne "[#######################...] (90%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 90 -a $PARAM_PROGRESS -ge 90 ]; then echo -ne "[##########################] (100%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 100 -a $PARAM_PROGRESS -ge 100 ];then echo -ne 'Done! \n' ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 0 -a $PARAM_PROGRESS -ge 0 ] ; then echo -ne "[..........................] (0%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 5 -a $PARAM_PROGRESS -ge 5 ] ; then echo -ne "[#.........................] (5%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 10 -a $PARAM_PROGRESS -ge 10 ]; then echo -ne "[##........................] (10%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 15 -a $PARAM_PROGRESS -ge 15 ]; then echo -ne "[###.......................] (15%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 20 -a $PARAM_PROGRESS -ge 20 ]; then echo -ne "[####......................] (20%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 25 -a $PARAM_PROGRESS -ge 25 ]; then echo -ne "[#####.....................] (25%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 30 -a $PARAM_PROGRESS -ge 30 ]; then echo -ne "[######....................] (30%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 35 -a $PARAM_PROGRESS -ge 35 ]; then echo -ne "[#######...................] (35%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 40 -a $PARAM_PROGRESS -ge 40 ]; then echo -ne "[########..................] (40%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 45 -a $PARAM_PROGRESS -ge 45 ]; then echo -ne "[#########.................] (45%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 50 -a $PARAM_PROGRESS -ge 50 ]; then echo -ne "[##########................] (50%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 55 -a $PARAM_PROGRESS -ge 55 ]; then echo -ne "[###########...............] (55%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 60 -a $PARAM_PROGRESS -ge 60 ]; then echo -ne "[############..............] (60%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 65 -a $PARAM_PROGRESS -ge 65 ]; then echo -ne "[#############.............] (65%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 70 -a $PARAM_PROGRESS -ge 70 ]; then echo -ne "[###############...........] (70%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 75 -a $PARAM_PROGRESS -ge 75 ]; then echo -ne "[#################.........] (75%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 80 -a $PARAM_PROGRESS -ge 80 ]; then echo -ne "[####################......] (80%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 85 -a $PARAM_PROGRESS -ge 85 ]; then echo -ne "[#######################...] (90%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 90 -a $PARAM_PROGRESS -ge 90 ]; then echo -ne "[##########################] (100%) $PARAM_PHASE \r" ; delay; fi;
|
||||
if [ $CURRENT_PROGRESS -le 100 -a $PARAM_PROGRESS -ge 100 ];then echo -ne 'Done! \n' ; delay; fi;
|
||||
|
||||
CURRENT_PROGRESS=$PARAM_PROGRESS;
|
||||
CURRENT_PROGRESS=$PARAM_PROGRESS;
|
||||
}
|
||||
|
@ -3,79 +3,79 @@
|
||||
|
||||
# Functions
|
||||
function vagrant-version() {
|
||||
vagrant --version
|
||||
vagrant --version
|
||||
}
|
||||
|
||||
function vagrant-init() {
|
||||
if [[ $1 ]]; then
|
||||
echo "Vagrant init for : $1 Creating...."
|
||||
vagrant init -m "$1"
|
||||
else
|
||||
echo "Usage : vai <box name>" >&2
|
||||
echo "Example : vai centos/7" >&2
|
||||
return 2
|
||||
fi
|
||||
if [[ $1 ]]; then
|
||||
echo "Vagrant init for : $1 Creating...."
|
||||
vagrant init -m "$1"
|
||||
else
|
||||
echo "Usage : vai <box name>" >&2
|
||||
echo "Example : vai centos/7" >&2
|
||||
return 2
|
||||
fi
|
||||
}
|
||||
|
||||
function vagrant-up() {
|
||||
if [[ $1 ]]; then
|
||||
echo "Vagrant up for provider : $1 Running...."
|
||||
vagrant up --provider "$1"
|
||||
else
|
||||
echo "Vagrant up for provider : virtualbox Running...."
|
||||
vagrant up
|
||||
fi
|
||||
if [[ $1 ]]; then
|
||||
echo "Vagrant up for provider : $1 Running...."
|
||||
vagrant up --provider "$1"
|
||||
else
|
||||
echo "Vagrant up for provider : virtualbox Running...."
|
||||
vagrant up
|
||||
fi
|
||||
}
|
||||
|
||||
function vagrant-plugin-vm() {
|
||||
case "$1" in
|
||||
"virtualbox")
|
||||
echo "Vagrant plugin install for provider : $1 Running...."
|
||||
vagrant plugin install vagrant-vbguest
|
||||
;;
|
||||
"libvirt")
|
||||
echo "Vagrant plugin install for provider : $1 Running...."
|
||||
vagrant plugin install vagrant-libvirt
|
||||
;;
|
||||
*)
|
||||
echo "Usage : vapvm <provider name>" >&2
|
||||
echo "Example : vapvm virtualbox" >&2
|
||||
return 2
|
||||
;;
|
||||
esac
|
||||
case "$1" in
|
||||
"virtualbox")
|
||||
echo "Vagrant plugin install for provider : $1 Running...."
|
||||
vagrant plugin install vagrant-vbguest
|
||||
;;
|
||||
"libvirt")
|
||||
echo "Vagrant plugin install for provider : $1 Running...."
|
||||
vagrant plugin install vagrant-libvirt
|
||||
;;
|
||||
*)
|
||||
echo "Usage : vapvm <provider name>" >&2
|
||||
echo "Example : vapvm virtualbox" >&2
|
||||
return 2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function vagrant-status() {
|
||||
if [[ -f Vagrantfile ]]; then
|
||||
vagrant status
|
||||
else
|
||||
vagrant global-status
|
||||
fi
|
||||
if [[ -f Vagrantfile ]]; then
|
||||
vagrant status
|
||||
else
|
||||
vagrant global-status
|
||||
fi
|
||||
}
|
||||
|
||||
function vagrant-ssh() {
|
||||
local VMCOUNT
|
||||
VMCOUNT=$(vagrant status | grep -c running)
|
||||
local VMDEFAULT
|
||||
VMDEFAULT=$(vagrant status | grep -w default | grep -c running)
|
||||
local VMCOUNT
|
||||
VMCOUNT=$(vagrant status | grep -c running)
|
||||
local VMDEFAULT
|
||||
VMDEFAULT=$(vagrant status | grep -w default | grep -c running)
|
||||
|
||||
if ((VMDEFAULT == 1)); then
|
||||
if [[ $1 ]]; then
|
||||
echo "SKIP : $1 Server...."
|
||||
fi
|
||||
echo "Login to : default Server...."
|
||||
vagrant ssh
|
||||
elif [[ $1 ]] && ((VMCOUNT > 1)); then
|
||||
echo "Login to : $1 Server...."
|
||||
vagrant ssh "$1"
|
||||
elif ((VMCOUNT == 0)); then
|
||||
echo "Seems like that not there running servers" >&2
|
||||
return 1
|
||||
else
|
||||
echo -e "Please choose a server from this list:\\n"
|
||||
vagrant status | awk '/running/{print $1}'
|
||||
echo -e "\\nThen fill: vagrant ssh [ option ]"
|
||||
if ((VMDEFAULT == 1)); then
|
||||
if [[ $1 ]]; then
|
||||
echo "SKIP : $1 Server...."
|
||||
fi
|
||||
echo "Login to : default Server...."
|
||||
vagrant ssh
|
||||
elif [[ $1 ]] && ((VMCOUNT > 1)); then
|
||||
echo "Login to : $1 Server...."
|
||||
vagrant ssh "$1"
|
||||
elif ((VMCOUNT == 0)); then
|
||||
echo "Seems like that not there running servers" >&2
|
||||
return 1
|
||||
else
|
||||
echo -e "Please choose a server from this list:\\n"
|
||||
vagrant status | awk '/running/{print $1}'
|
||||
echo -e "\\nThen fill: vagrant ssh [ option ]"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user