1
0
Fork 0
mirror of https://github.com/sbrl/bin.git synced 2018-01-10 21:33:46 +00:00

Enhance cloudjumper

This commit is contained in:
Starbeamrainbowlabs 2017-07-05 13:16:01 +01:00
parent 30f549c067
commit 363ae18087

36
cloudjumper/cloudjumper.sh Normal file → Executable file
View file

@ -1,18 +1,46 @@
#!/usr/bin/env bash
echo -ne "Initialsing cloudsurfer: ";
### Settings ###
aliases_url="https://raw.githubusercontent.com/sbrl/bin/master/.bash_aliases";
################
echo -ne "s";
### Aliases file ###
aliases_tmp_file=$(mktemp --suffix ".cloudjumper.sh");
curl -o "${aliases_tmp_file}" "${aliases_url}"
chmod u+x "${aliases_tmp_file}"
curl -o "${aliases_tmp_file}" "${aliases_url}" 2>/dev/null;
ec_alias_download="$?";
if [[ "${ec_alias_download}" -ne "0" ]]; then
echo "E";
echo "Error\! Got exit code ${ec_alias_download} from curl when downloading the bash_aliases file";
exit ${ec_alias_download};
fi;
chmod u+x "${aliases_tmp_file}";
source "${aliases_tmp_file}"
source "${aliases_tmp_file}";
####################
echo -ne "+a";
rm "${aliases_tmp_file}"
### Prompt ###
# Set the prompt to a cyan / blue colour to let everyone know we've enabled cloudjumper successfully
PS1="\[\033[1m\]\[\033[34m\]${PS1}\[\033[0m\]";
##############
echo -ne "+p";
### Cleanup ###
rm "${aliases_tmp_file}" >/dev/null;
###############
echo -ne "+c";
echo " - done";