23 lines
605 B
Bash
Executable File
23 lines
605 B
Bash
Executable File
#! /bin/bash
|
|
|
|
if [[ $(uname -m) == "x86_64" ]]
|
|
then
|
|
wget --backups=0 "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.7.tgz"
|
|
tar -zxf ./mongodb-linux-x86_64-ubuntu1604-3.2.7.tgz --strip-components=1
|
|
else
|
|
IFS=" " read -a links <<< $(apt-get -y --print-uris install mongodb | egrep -o "https?://[^']+")
|
|
for link in ${links[@]}
|
|
do
|
|
wget --backups=0 ${link}
|
|
done
|
|
|
|
IFS=" " read -a deb_pkgs <<< $(ls ./ | egrep "\.deb")
|
|
for pkg in ${deb_pkgs[@]}
|
|
do
|
|
echo "Extracting ${pkg}..."
|
|
dpkg-deb -R ${pkg} ./
|
|
done
|
|
|
|
mv usr/bin bin
|
|
fi
|