-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfed_conf.sh
executable file
·363 lines (271 loc) · 7.69 KB
/
fed_conf.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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
#! /bin/sh
##
## This script automate the regulare Fedora configartaion.
##
##
######################################################################
################### Functions to add the repos #######################
######################################################################
RPMFUSION_REPOS () {
echo "Installing RPM Fusion free and non-free repos..."
dnf --assumeyes install \
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
if [ $? -ne 0 ]
then
echo "Problem hapened. RPM Fusion does not installed."
else
echo "Done."
fi
}
OJUBA_OF_MOCEAP () {
echo "Adding ojuba repo..."
cat > $REPO_PATH/_copr_moceap-Ojuba.repo << _EOF_
[moceap-Ojuba]
name=Copr repo for Ojuba owned by moceap
baseurl=https://copr-be.cloud.fedoraproject.org/results/moceap/Ojuba/fedora-$releasever-$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/moceap/Ojuba/pubkey.gpg
enabled=0
enabled_metadata=1
_EOF_
if [ $? -ne 0 ]
then
echo "Problem hapened. Ojuba repository does not Added."
else
echo "Added Ojuba to the repositores."
fi
}
GOOGLE_CHROME_REPO () {
echo "Adding google-chrome repo file..."
cat > $REPO_PATH/google-chrome.repo <<- _EOF_
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub
_EOF_
echo "Done."
}
ORECAL_VIRTUALBOX () {
echo "Adding orecal virtualBox repo file..."
cat > $REPO_PATH/virtualbox.repo << _EOF_
[virtualbox]
name=Fedora $releasever - $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/fedora/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
_EOF_
echo "Done."
}
VSCODE_REPO () {
echo "Adding visual studio code repo file..."
cat > $REPO_PATH/vscode.repo << _EOF_
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
_EOF_
echo "Done."
}
GREEN_RECORDER_REPO () {
# green recorder is a screan recorder program
echo "Adding green recorder repo file..."
cat > $REPO_PATH/home\:mhsabbagh.repo << _EOF_
[home_mhsabbagh]
name=home:mhsabbagh (Fedora_26)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/home:/mhsabbagh/Fedora_26/
enabled=1
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/home:/mhsabbagh/Fedora_26/repodata/repomd.xml.key
_EOF_
echo "Done."
}
KENZY_REPO () {
# Kenzy is a distro developed by Muhammed Sha'ban.
# He is a member of Linux Arab Comunity (linuxac.org)
echo "Adding Kenzy repo file..."
cat > $REPO_PATH/Kenzy_packages.repo << _EOF_
[home_Kenzy_packages]
name=Kenzy Packages (Fedora_24)
type=rpm-md
baseurl=http://download.opensuse.org/repositories/home:/Kenzy:/packages/Fedora_24/
enabled=0
gpgcheck=1
gpgkey=http://download.opensuse.org/repositories/home:/Kenzy:/packages/Fedora_24//repodata/repomd.xml.key
_EOF_
echo "Done."
}
######################################################################
############### Function to install the wanted packages ##############
######################################################################
INSTALL_MULIMEDIA_PKGS () {
echo "Installing multimedia programes and codecs..."
local PROGS
PROGS="audacity-freeworld \
youtube-dl \
green-recorder \
vlc"
local CODECS
CODECS="gstreamer1-plugin-mpg123 mpg123-libs"
#The installation command
$INSTALL_CMD $PROGS $CODECS
echo "Done."
}
INSTALL_DEV_PKGS () {
echo "Installing the dev pakages..."
local PKGS
PKGS="virtaal \
sqlitebrowser"
local COMPILERS
COMPILERS="golang golang-docs \
nasm"
#The installation command
$INSTALL_CMD $PKGS $COMPILERS
}
INSTALL_THESE_PKG () {
echo "Installing packages..."
local GNOME_EXTRA
GNOME_EXTRA="gnome-tweak-tool \
gnome-terminal-nautilus"
local PYTHON_PKGS
PYTHON_PKGS="pylint \
python-virtualenv-doc \
python2-flask \
python2-pylint \
python2-sphinx \
python2-virtualenv \
python3-gammu \
python3-ipython \
python3-pylint \
python3-sqlalchemy \
python3-virtualenv"
local OJUBA_APPS
OJUBA_APPS="othman \
hijra-applet"
local DAWAWIN
DAWAWIN="dawawin \
dawawin-extra-books"
local GAMES
GAMES="gnome-mines"
local TERMINAL_UTIL
TERMINAL_UTIL="mc \
screenfetch"
# Window managers
local WM
WM="openbox"
# Archivers and Comparison tools
local ARCH_AND_COMP
ARCH_AND_COMP="unzip unrar p7zip"
local EXTRA
EXTRA="VirtualBox-5* \
keepass-2* \
hunspell-ar \
vim-syntastic-python \
gedit-plugins \
nano \
xterm \
lm_sensors \
mediawriter \
google-chrome-stable \
thunderbird"
#The installation command
$INSTALL_CMD $PYTHON_PKGS $EXTRA $ARCH_AND_COMP\
$GNOME_EXTRA $GAMES $COMPILERS $TERMINAL_UTIL $WM
#echo $OJUBA_APPS $PYTHON_PKGS $DAWAWIN
}
INSTALL_GROUPS () {
#local DEV
#DEV="Development tools"
#local ARA
#ARA='"arabic support" --exclude=kacst*'
#dnf --assumeyes groupinstall $DEV $ARA
dnf --assumeyes groupinstall "arabic support" --exclude=kacst* "Development tools"
}
######################################################################
################### Functions to make some configs ###################
######################################################################
MOUNT_WITHOUT_PASSWD () {
# Add role to mount the partations with out superuser primission.
echo "Adding role to mount the partations with out superuser primission..."
cat >/etc/polkit-1/rules.d/10-ojuba-udisks.rules << EOF
/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */
// DO NOT EDIT THIS FILE, it will be overwritten on ojuba-desktop-settings update
//
// Default rules for polkit
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.udisks2.filesystem-mount-system") {
return polkit.Result.YES;
}
});
EOF
if [ $? -ne 0 ]
then
echo "Problem hapened."
else
echo "Now you can mount any partation without root permesion."
fi
} ## end of MOUNT_WITHOUT_PASSWD
######################################################################
######################## Script starts from here #####################
######################################################################
## cheak if the script run as administer
if [ $EUID -ne 0 ]
then
echo "You must run the script as root, or run it using sudo."
exit 1
fi
echo
echo "Hi, welcome to fedora `rpm -E %fedora`."
echo "This script will confiure your distripution."
## don't forget to change it to the real path
## /etc/yum.repos.d/
REPO_PATH="/etc/yum.repos.d/"
INSTALL_CMD="dnf --assumeyes install"
echo
printf 'Would you like to update the distro now? [y, n] '
read UPDATE_CHEAK
if [ -z $UPDATE_CHEAK ]
then
## without this if cluse the shell return
## this error "too many arguments"
echo "Skiped."
elif [ $UPDATE_CHEAK == 'y' -o $UPDATE_CHEAK == 'Y' ]
then
echo "Updating..."
#dnf --assumeyes update
if [ $? -ne 0 ]
then
echo
echo "There is a problem."
else
echo
echo "Done"
fi
else
echo "Skiped."
fi
#echo
#echo "Adding repos..."
#RPMFUSION_REPOS
#OJUBA_OF_MOCEAP
#GOOGLE_CHROME_REPO
#ORECAL_VIRTUALBOX
#VSCODE_REPO
#GREEN_RECORDER_REPO
#KENZY_REPO
echo
echo "Installing apps..."
#INSTALL_MULIMEDIA_PKGS
#INSTALL_THESE_PKG
#INSTALL_DEV_PKGS
#INSTALL_GROUPS
#MOUNT_WITHOUT_PASSWD
echo "Good bye!"
exit