2022-04-04 18:06:01 +02:00
#!/bin/bash
# Get linux distro
DISTRO = $( lsb_release -is)
2022-04-27 18:28:42 +02:00
if [ [ $( id -u) != "0" ] ] && [ [ $1 != "force" ] ] ; then
echo "You must run this script as root! (To skip this, run with 'force' arg: \"./configure.sh force\")"
2022-04-27 18:47:57 +02:00
exit 1
2022-04-27 18:28:42 +02:00
fi
2022-04-04 18:06:01 +02:00
# Get COMMAND
if [ [ $DISTRO = = "Arch" ] ] ; then
2022-06-11 18:54:14 +02:00
COMMAND = "pacman -S --needed --noconfirm gcc json-c curl make libgit2 tmux"
2022-04-04 18:06:01 +02:00
elif [ [ $DISTRO = = "Ubuntu" ] ] || [ [ $DISTRO = = "Debian" ] ] ; then
2022-06-11 18:54:14 +02:00
COMMAND = "apt install -y gcc libjson-c-dev libcurl4-nss-dev make libgit2-dev tmux"
2022-04-04 18:06:01 +02:00
else
# 'Unsupported' distro
2022-06-11 18:54:14 +02:00
echo "It seems you are using unsupported distribution... Don't worry, just install 'gcc', 'json-c', 'curl', 'libgit2', 'tmux' and 'make' and you'll be fine."
2022-04-27 18:28:42 +02:00
exit
2022-04-04 18:06:01 +02:00
fi
# Execute COMMAND
2022-04-06 19:05:21 +02:00
$COMMAND