Last active
December 23, 2018 03:15
-
-
Save ridingintraffic/7c60ec7158253fe16c3ccc6c1c1896cc to your computer and use it in GitHub Desktop.
system detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# loading the system speicfic profiles | |
if [ "Linux" = "$(uname -a | awk '{printf $1}')" ]; then | |
if [ "raspbian" = "$(cat /etc/os-release | grep ^ID= |sed 's/ID=//')" ]; then | |
echo "raspbian" | |
source "$HOME/.rpi_profile" | |
elif [ "ubuntu" = "$(cat /etc/os-release | grep ^ID= |sed 's/ID=//')" ]; then | |
echo "ubuntu" | |
source "$HOME/.ubu_profile" | |
elif [ "centos" = "$(cat /etc/os-release | grep ^ID= |sed 's/ID=//')" ]; then | |
echo "centos" | |
source "$HOME/.centos_profile" | |
elif [ "kali" = "$(cat /etc/os-release | grep ^ID= |sed 's/ID=//')" ]; then | |
echo "kali" | |
source "$HOME/.kali_profile" | |
else | |
echo "unknown" | |
fi | |
fi | |
if [ "Mac" = "$(sw_vers|grep ProductName |awk '{printf $2}')" ]; then | |
if [ "home_computer" = "$(hostname)" ]; then | |
source "$HOME/.home_profile" | |
fi | |
if [ "work_computer" = "$(hostname)" ]; then | |
source "$HOME/.work_profile" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment