Skip to content

Instantly share code, notes, and snippets.

@jmuchovej
Last active March 30, 2017 13:42
Show Gist options
  • Save jmuchovej/c45dc4152fbbb6375e8116bf8e1a5e24 to your computer and use it in GitHub Desktop.
Save jmuchovej/c45dc4152fbbb6375e8116bf8e1a5e24 to your computer and use it in GitHub Desktop.
Determines the OS of your machine to utilize the proper repositories to install software.
#!/bin/bash
if [[ $# -eq 0 ]]
then
inst = ""
for i in "$@"
do
inst = "$inst $i"
done
fi
source /etc/os-release
case $ID in:
"linuxmint")
"ubuntu")
apt update -y
if [[ $# -eq 0 ]] then
apt install -y $inst
fi
;;
"arch")
yaourt -Sy
if [[ $# -eq 0 ]] then
yaourt -S $inst
fi
;;
*)
echo "Uh-oh! Looks like your OS isn't familiarized, you can edit this yourself though. :)"
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment