diff options
author | Joachim Tingvold <joachim@tingvold.com> | 2014-04-06 03:11:04 +0200 |
---|---|---|
committer | Joachim Tingvold <joachim@tingvold.com> | 2014-04-06 03:11:04 +0200 |
commit | 2a0c0a3dbbdf7fa5040953c0b0d88ad6f62c011e (patch) | |
tree | 92c7cbf54272466b46f64e5dc8d1ddb429858836 /tools/install-dependencies.sh | |
parent | fe0be5960aac1f9bb600dbf853d862a9f4e60de8 (diff) |
Initial commit. Source; TG13-goodiebag.
Diffstat (limited to 'tools/install-dependencies.sh')
-rwxr-xr-x | tools/install-dependencies.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tools/install-dependencies.sh b/tools/install-dependencies.sh new file mode 100755 index 0000000..bf68134 --- /dev/null +++ b/tools/install-dependencies.sh @@ -0,0 +1,53 @@ +#!/bin/bash -e + +if [ "$1" != "master" -a "$1" != "slave" -a "$1" != "boot" ]; then + echo "Run as $0 <boot|master|slave>" + exit +fi + +# OK, we know the content of $0 is OK. I prefer sane names. +ROLE=$1; + +# Start by installing common packages. Remember to update +# this when a new common dependency is discovered, plx. +apt-get -y install \ + vim-nox \ + git \ + ntp \ + screen \ + dnsutils \ + build-essential \ + libnet-ip-perl \ + libnetaddr-ip-perl \ + libnet-telnet-cisco-perl \ + libnet-ping-external-perl \ + perl-modules \ + libdbi-perl \ + libdbd-pg-perl \ + libnet-telnet-perl + +if [ "${ROLE}" == "boot" ]; then + # Install-tasks specific for the _bootstrab box_ here + echo "Installing for bootstrap" + apt-get -y install \ + bind9utils +fi + +if [ "${ROLE}" == "master" ]; then + # Install-tasks specific for the _primary_ here + echo "Installing for primary/master" + apt-get -y install \ + isc-dhcp-server \ + bind9utils \ + bind9 +fi + +if [ "${ROLE}" == "slave" ]; then + # Install-tasks specific for the _secondary_ here + echo "Installing for secondary/slave" + apt-get -y install \ + bind9utils \ + bind9 +fi + +echo "Dependency installation for ${ROLE} complete." |