Skip to content

Instantly share code, notes, and snippets.

@jcrashkit
Created February 28, 2020 22:30
Show Gist options
  • Save jcrashkit/01efa4df84fa7404b3a8f36ece29a300 to your computer and use it in GitHub Desktop.
Save jcrashkit/01efa4df84fa7404b3a8f36ece29a300 to your computer and use it in GitHub Desktop.
baseUp() {
target=$1
if [ -z "$target" ]
then
echo -e "\e[31mUndefined\e[0m"
fi
domain=`echo $target | sed -e 's|^[^/]*//||' -e 's|/.*$||'`
targetWs=$WS/targets/$domain
if [ -d $WS/targets ]
then
echo "kk"
else
echo -e "\e[31mUnfound\e[0m\n\n -cmd: \e[32mmkdir\e[0m $WS/targets"
mkdir $WS/targets
fi
if [ -d $WS/targets/$domain ]
then
PWD=$WS/targets/$domain
echo -e "\e[32mfound\e[0m\n\n -cmd: PWD=$WS/targets/$domain"
cd $targetWs
else
echo -e "\e[31mUnfound\e[0m\n\n -cmd: \e[32mmkdir\e[0m $WS/targets/$domain"
mkdir $WS/targets/$domain
fi
return 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment