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

47 lines
945 B
Bash
Raw Normal View History

2017-06-09 12:11:20 +00:00
#!/usr/bin/env bash
2017-07-05 12:16:01 +00:00
echo -ne "Initialsing cloudsurfer: ";
2017-06-09 12:11:20 +00:00
### Settings ###
2017-06-12 11:58:50 +00:00
aliases_url="https://raw.githubusercontent.com/sbrl/bin/master/.bash_aliases";
2017-06-09 12:11:20 +00:00
################
2017-07-05 12:16:01 +00:00
echo -ne "s";
### Aliases file ###
2017-06-09 12:11:20 +00:00
aliases_tmp_file=$(mktemp --suffix ".cloudjumper.sh");
2017-07-05 12:16:01 +00:00
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}";
####################
echo -ne "+a";
### 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";
2017-06-09 12:11:20 +00:00
2017-07-05 12:16:01 +00:00
### Cleanup ###
2017-06-09 12:11:20 +00:00
2017-07-05 12:16:01 +00:00
rm "${aliases_tmp_file}" >/dev/null;
2017-06-09 12:11:20 +00:00
2017-07-05 12:16:01 +00:00
###############
echo -ne "+c";
2017-06-09 12:11:20 +00:00
2017-07-05 12:16:01 +00:00
echo " - done";