This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dmitriy Kalinin and Pieter Noordhuis
committed
Mar 18, 2013
1 parent
2ea0203
commit f698fcb
Showing
4 changed files
with
79 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
[ -n "$DEBUG" ] && set -o xtrace | ||
set -o nounset | ||
set -o errexit | ||
shopt -s nullglob | ||
shopt -s globstar | ||
|
||
if [ $EUID -ne 0 ] | ||
then | ||
echo "Sorry, you need to be root." | ||
exit 1 | ||
fi | ||
|
||
if [ "$#" -ne 1 ] | ||
then | ||
echo "Usage: setup.sh [TARGET DIRECTORY]" | ||
exit 1 | ||
fi | ||
|
||
target=$1 | ||
|
||
if [ -d $target ] | ||
then | ||
read -p "Target directory already exists. Erase it? " | ||
if [[ $REPLY =~ ^[Yy].*$ ]] | ||
then | ||
rm -rf $target | ||
else | ||
echo "Aborting..." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
mkdir -p $target | ||
|
||
tmpdir=$(mktemp -d) | ||
yumdownloader --destdir=$tmpdir centos-release | ||
rpm -iv --nodeps --root $target $tmpdir/centos-release-*.rpm | ||
rm -rf $tmpdir | ||
|
||
yum -y --installroot $target install yum | ||
yum -y --installroot $target groupinstall "Development Tools" | ||
yum -y --installroot $target install zlib-devel | ||
yum -y --installroot $target install openssl-devel | ||
yum -y --installroot $target install readline-devel | ||
|
||
# Only used for tests | ||
yum -y --installroot $target install nc |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
[ -n "$DEBUG" ] && set -o xtrace | ||
set -o nounset | ||
set -o errexit | ||
shopt -s nullglob | ||
shopt -s globstar | ||
|
||
if [ ! -f /etc/issue ] | ||
then | ||
echo "/etc/issue doesn't exist; cannot determine distribution" | ||
exit 1 | ||
fi | ||
|
||
if grep -q -i ubuntu /etc/issue | ||
then | ||
exec $(dirname $0)/ubuntu.sh $@ | ||
fi | ||
|
||
if grep -q -i centos /etc/issue | ||
then | ||
exec $(dirname $0)/centos.sh $@ | ||
fi | ||
|
||
echo "Unknown distribution: $(head -1 /etc/issue)" | ||
exit 1 |
This file contains 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