-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathinstall.sh
executable file
·74 lines (69 loc) · 1.77 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
##
# Author: Alex Kulikov <alex.kulikov@xing.com>
# Version: 0.2
# Description: Installer for TinyPNG.
##
# Check the script is being run by root
if [ "$(id -u)" != "0" ];
then
echo "This script must be run as root"
exit 1
fi
function instDarwin ()
{
if [ `which port > /dev/null || echo "1"` ];
then
echo "You need Mac-Ports. (http://www.macports.org)"
else
mv README README.bak
curl http://static.jonof.id.au/dl/kenutils/pngout-20070430-darwin.tar.gz > pngout.tar.gz
tar -xzvf pngout.tar.gz
rm pngout.tar.gz
sudo mv pngout-darwin /usr/bin/pngout
sudo cp tinypng /usr/bin/tinypng
sudo port install pngcrush AdvanceCOMP optipng
mv README.bak README
echo "done."
fi
}
function instLinux ()
{
if [ `which apt-get > /dev/null || echo "1"` ];
then
echo "apt-get not avaible!"
else
curl http://static.jonof.id.au/dl/kenutils/pngout-20070430-linux.tar.gz > pngout.tar.gz
tar -xzvf pngout.tar.gz
echo "Choose your processor architecture."
echo "1) athlon"
echo "2) i386"
echo "3) i686"
echo "4) pentium4"
read architecture;
case $architecture in
1) sudo cp pngout-linux-athlon /usr/bin/pngout;;
2) sudo cp pngout-linux-i386 /usr/bin/pngout;;
3) sudo cp pngout-linux-i686 /usr/bin/pngout;;
4) sudo cp pngout-linux-pentium4 /usr/bin/pngout;;
esac
rm README
rm pngout.tar.gz
rm pngout-linux-athlon
rm pngout-linux-i386
rm pngout-linux-i686
rm pngout-linux-pentium4
sudo apt-get install pngcrush AdvanceCOMP optipng
echo "done."
fi
}
# Check the OS Type
OS=`uname`
if [ $OS = "Darwin" ];
then
instDarwin
fi
if [ $OS = "Linux" ];
then
instLinux
fi