-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_workspace32.sh
201 lines (148 loc) · 4.34 KB
/
install_workspace32.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#/
# * @author cleber_rodrigues
# *
# */
#!/bin/bash
# Set to false to not install the applications, changing the variables below:
### DEFINE FLAG TO INSTALL
jdk17Install=true
chromeInstall=true
skypeInstall=true
guakeInstall=true
virtualbox=true
PgAdmin3Install=true
geanyInstall=true
### DEFINE FLAG TO INSTALL-END
### DEFAULT FLAGS
configureProxy=true
### DEFAULT FLAGS-END
### FOLDER DEFINITION
jdkSourceFile="jdk-7u65-linux-i586.tar.gz"
jdkFolder="jdk1.7"
jvmPath="/usr/lib/jvm"
jreSourceFile="jre-7u65-linux-i586.tar.gz"
jreFolder="jre1.7"
pwdOriginal="`pwd`"
### FOLDER DEFINITION-END
### APP DEFINITION
7zip="7z920.tar.bz2"
virtualBoxFile="virtualbox-4.3_4.3.12-93733~Ubuntu~raring_i386.deb"
chromeDEB="google-chrome-stable_current_i386.deb"
nvidiaDrive="NVIDIA-Solaris-x86-319.17.run"
### APP DEFINITION-END
### CONFIG FILES DEFINITION
token_file="token.jnlp"
maven_setting="settings.xml"
apt="apt.conf"
plugin_java="libnpjp2.so"
### CONFIG FILES DEFINITION-END
### SCRIPT DOWNLOADER
### INIT COMMANDS
#Give permission for all files.
sudo chmod 777 -R $pwdOriginal
# Create alls folders
sudo mkdir /logs
sudo mkdir $jvmPath
sudo mkdir -p /opt/google/chrome/plugins
sudo mkdir ~/.m2
### INIT COMMANDS-END
### PROXY CONFIGURATION
if $configureProxy = true ; then
# Configure proxy
> $apt
echo "Type your global password: " ; read password
echo 'Acquire::http::Proxy "http://'$USER':'$password'@143.116.92.201:64000";' >> $apt
sudo cp $apt /etc/apt/
> $apt
gsettings set org.gnome.system.proxy mode 'auto'
fi
### PROXY CONFIGURATION-END
### UPTADE APT-GET REPOSITORY
if $skypeInstall = true ; then
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
fi
### UPTADE APT-GET REPOSITORY-END
# Update packages
sudo apt-get update
### APT-GET PACKAGES
if $skypeInstall = true ; then
# Install Skype
sudo apt-get -y install skype
fi
if $PgAdmin3Install = true ; then
# Install PgAdmin3
sudo apt-get -y install pgadmin3
fi
if $guakeInstall = true ; then
# Install Guake Termial
sudo apt-get -y install guake
fi
if $geanyInstall = true ; then
# Install Geany (Notepad++ Alternative)
sudo apt-get -y install geany
fi
if $chromeInstall = true ; then
# Download and Install Google Chrome
sudo apt-get -y install libappindicator1
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
fi
### APT-GET PACKAGES-END
### MAIN JAVA INSTALL
if $jdk17Install = true ; then
# Copy all files
cd $pwdOriginal
sudo cp $jdkSourceFile $jvmPath
sudo cp $jreSourceFile $jvmPath
# Extract the Java Packages
cd $jvmPath
sudo chmod 777 -R $jvmPath
sudo tar -zxvf $jdkSourceFile
sudo tar -zxvf $jreSourceFile
# Rename folders
sudo mv jdk1.7.0_65 $jdkFolder
sudo mv jre1.7.0_65 $jreFolder
# Give permissions
sudo chmod 777 -R $$jvmPath
# Install Java
sudo update-alternatives --install /usr/bin/javac javac $jvmPath/$jdkFolder/bin/javac 1
sudo update-alternatives --install /usr/bin/java java $jvmPath/$jdkFolder/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws $jvmPath/$jdkFolder/bin/javaws 1
# Install Java Plugin
cd /usr/lib/firefox-addons/plugins/
sudo ln -s $jvmPath/$jreFolder/lib/i386/$plugin_java
cd /opt/google/chrome/plugins
sudo ln -s $jvmPath/$jreFolder/lib/i386/$plugin_java
# Install Environment Variables
export JAVA_HOME=/usr/lib/jvm/jdk1.7
export PATH=$PATH:$JAVA_HOME/bin
xdg-mime install $jvmPath/$jreFolder/lib/desktop/mime/packages/x-java-jnlp-file.xml
# Associate jnlp files
cd $pwdOriginal
cp mimeapps.list ~/.local/share/applications
fi
### MAIN JAVA INSTALL-END
### FILE INSTALL
###virtualbox
if $virtualbox = true ; then
# Install VirtualBox
sudo dpkg --configure -a
sudo apt-get -y install libsdl1.2debian
sudo dpkg -i $virtualBoxFile
sudo /etc/init.d/vboxdrv setup
fi
###virtualbox-END
### FILE INSTALL-END
### GENERAL CONFIGURATION FILES
# Copy profile with environment variables
cd $pwdOriginal
sudo cp bashrc ~/.bashrc
sudo cp $maven_setting ~/.m2/
sudo chmod 777 -R ~/.m2/
#Create a link for Eclipse
cd ~/Desktop
ln -s /usr/dev/tool-dev/ide/eclipse/eclipse
# Copy Token to Desktop
cd $pwdOriginal
sudo cp $token_file ~/Desktop
### GENERAL CONFIGURATION FILES-END