mirror of
https://github.com/teddysun/across.git
synced 2025-01-18 22:09:35 +08:00
Add unixbench.sh
This commit is contained in:
parent
d9e72ec328
commit
0ee1583790
49
unixbench.sh
Normal file
49
unixbench.sh
Normal file
@ -0,0 +1,49 @@
|
||||
#! /bin/bash
|
||||
#==============================================================#
|
||||
# Description: Unixbench script #
|
||||
# Author: Teddysun <i@teddysun.com> #
|
||||
# Intro: https://teddysun.com/245.html #
|
||||
#==============================================================#
|
||||
|
||||
# Check System
|
||||
[[ $EUID -ne 0 ]] && echo 'Error: This script must be run as root!' && exit 1
|
||||
egrep -i "centos" /etc/issue && os='centos'
|
||||
egrep -i "debian" /etc/issue && os='debian'
|
||||
egrep -i "ubuntu" /etc/issue && os='ubuntu'
|
||||
[ "$os" == '' ] && echo 'Error: Your system is not supported to run it!' && exit 1
|
||||
|
||||
# Install necessary libaries
|
||||
if [ "$os" == 'centos' ]; then
|
||||
yum -y install make automake gcc gcc-c autoconf gcc-c++ time perl-Time-HiRes
|
||||
else
|
||||
apt-get -y update
|
||||
apt-get -y install make automake gcc autoconf time perl
|
||||
fi
|
||||
|
||||
# Create new soft download dir
|
||||
mkdir -p /opt/unixbench
|
||||
cd /opt/unixbench
|
||||
cur_dir=`pwd`
|
||||
|
||||
# Download UnixBench5.1.3
|
||||
if [ -s UnixBench5.1.3.tgz ]; then
|
||||
echo "UnixBench5.1.3.tgz [found]"
|
||||
else
|
||||
echo "UnixBench5.1.3.tgz not found!!!download now..."
|
||||
if ! wget -c http://lamp.teddysun.com/files/UnixBench5.1.3.tgz; then
|
||||
echo "Failed to download UnixBench5.1.3.tgz, please download it to ${cur_dir} directory manually and try again."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
tar -xzf UnixBench5.1.3.tgz
|
||||
cd UnixBench/
|
||||
|
||||
#Run unixbench
|
||||
make
|
||||
./Run
|
||||
|
||||
echo ''
|
||||
echo ''
|
||||
echo "======= Script description and score comparison completed! ======= "
|
||||
echo ''
|
||||
echo ''
|
Loading…
x
Reference in New Issue
Block a user