linux-setup.sh 13.4 KB
Newer Older
Microlinux's avatar
Microlinux committed
1
2
#!/bin/bash
#
Microlinux's avatar
Microlinux committed
3
# linux-setup.sh
Microlinux's avatar
Microlinux committed
4
#
Microlinux's avatar
Microlinux committed
5
# (c) Niki Kovacs 2021 <info@microlinux.fr>
Microlinux's avatar
Microlinux committed
6
#
Microlinux's avatar
Microlinux committed
7
8
# This script turns a minimal Oracle Linux installation into a more functional
# base system for various server configurations.
Microlinux's avatar
Microlinux committed
9

10
11
12
13
14
15
# Current directory
CWD=$(pwd)

# Slow things down a bit
SLEEP=1

Microlinux's avatar
Microlinux committed
16
# Make sure we're running Oracle Linux 7.x or 8.x.
Microlinux's avatar
Microlinux committed
17
18
19
source /etc/os-release
if [ "${?}" -ne 0 ]
then
20
  echo
Microlinux's avatar
Microlinux committed
21
  echo "Unsupported operating system." >&2
22
  echo
Microlinux's avatar
Microlinux committed
23
24
  exit 1
fi
25

Microlinux's avatar
Microlinux committed
26
case "${ORACLE_BUGZILLA_PRODUCT}" in
27
28
  "Oracle Linux 7"|"Oracle Linux 8")
    VERSION=$(echo ${ORACLE_BUGZILLA_PRODUCT} | cut -d' ' -f3)
Microlinux's avatar
Microlinux committed
29
30
    ;;
  *)
31
  echo
Microlinux's avatar
Microlinux committed
32
  echo "Unsupported operating system." >&2
33
  echo
Microlinux's avatar
Microlinux committed
34
35
36
  exit 1
esac

37
38
39
40
41
42
echo
echo "  ################################"
echo "  # Oracle Linux ${VERSION} configuration #"
echo "  ################################"
echo
sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
43
44
45
46
47
48
49

# Defined users
USERS="$(awk -F: '$3 > 999 {print $1}' /etc/passwd | sort)"

# Admin user
ADMIN=$(getent passwd 1000 | cut -d: -f 1)

Microlinux's avatar
Microlinux committed
50
# Remove these packages
51
CRUFT=$(egrep -v '(^\#)|(^\s+$)' ${CWD}/el${VERSION}/yum/useless-packages.txt)
Microlinux's avatar
Microlinux committed
52

Microlinux's avatar
Microlinux committed
53
# Install these packages
54
EXTRA=$(egrep -v '(^\#)|(^\s+$)' ${CWD}/el${VERSION}/yum/extra-packages.txt)
Microlinux's avatar
Microlinux committed
55

Microlinux's avatar
Microlinux committed
56
57
58
# Enhanced base system
BASE=$(egrep -v '(^\#)|(^\s+$)' ${CWD}/el${VERSION}/yum/enhanced-base.txt)

Microlinux's avatar
Microlinux committed
59
60
# Mirrors
CISOFY="https://packages.cisofy.com"
Microlinux's avatar
Microlinux committed
61
ICINGA="https://packages.icinga.com"
Microlinux's avatar
Microlinux committed
62

63
# EPEL
64
65
66
67
68
69
70
EPELURL="http://mirrors.ircam.fr/pub/fedora/epel/7/x86_64/Packages/e"
EPELRPM="${EPELURL}/epel-release-7-13.noarch.rpm"

# Software Collections
SCLURL="http://mirror.centos.org/centos-7/7/extras/x86_64/Packages"
SCLRPM[1]="${SCLURL}/centos-release-scl-rh-2-3.el7.centos.noarch.rpm"
SCLRPM[2]="${SCLURL}/centos-release-scl-2-3.el7.centos.noarch.rpm"
71

Microlinux's avatar
Microlinux committed
72
73
74
75
# Delta RPM
DELTARPM[7]="deltarpm"
DELTARPM[8]="drpm"

Microlinux's avatar
Microlinux committed
76
77
78
79
80
# Log
LOG="/tmp/$(basename "${0}" .sh).log"
echo > ${LOG}

usage() {
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
  # Display help message
  echo "  Usage: ${0} OPTION"
  echo
  echo "  Oracle Linux ${VERSION} post-install configuration for servers."
  echo
  echo "  Options:"
  echo
  echo "    --shell    Configure shell: Bash, Vim, console, etc."
  echo "    --repos    Setup official and third-party repositories."
  echo "    --fresh    Sync repositories and fetch updates."
  echo "    --extra    Install enhanced base system."
  echo "    --strip    Remove unneeded system components."
  echo "    --logs     Enable admin user to access system logs."
  echo "    --ipv4     Disable IPv6 and reconfigure basic services."
  echo "    --sudo     Configure persistent password for sudo."
  echo "    --setup    Perform all of the above in one go."
  echo "    --reset    Revert back to enhanced base system."
  echo
  echo "  Logs are written to ${LOG}."
  echo
Microlinux's avatar
Microlinux committed
101
102
}

Microlinux's avatar
Microlinux committed
103
configure_shell() {
104
105
106
  echo "  === Shell configuration ==="
  echo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
107
  # Install custom command prompts and a handful of nifty aliases.
108
  echo "  Configuring Bash shell for user: root"
109
  cat ${CWD}/el${VERSION}/bash/bashrc-root > /root/.bashrc
Microlinux's avatar
Microlinux committed
110
  sleep ${SLEEP}
111
  echo "  Configuring Bash shell for future users."
112
  cat ${CWD}/el${VERSION}/bash/bashrc-users > /etc/skel/.bashrc
Microlinux's avatar
Microlinux committed
113
114
115
116
117
118
119
120
  sleep ${SLEEP}
  # Existing users might want to use it.
  if [ ! -z "${USERS}" ]
  then
    for USER in ${USERS}
    do
      if [ -d /home/${USER} ]
      then
121
        echo "  Configuring Bash shell for user: ${USER}"
Nicolas Kovacs's avatar
Nicolas Kovacs committed
122
123
124
        cat ${CWD}/el${VERSION}/bash/bashrc-users > /home/${USER}/.bashrc
        chown ${USER}:${USER} /home/${USER}/.bashrc
        sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
125
126
127
128
      fi
    done
  fi
  # Add a handful of nifty system-wide options for Vim.
129
  echo "  Configuring system-wide options for Vim."
130
  cat ${CWD}/el${VERSION}/vim/vimrc > /etc/vimrc
Microlinux's avatar
Microlinux committed
131
132
  sleep ${SLEEP}
  # Set english as main system language.
133
  echo "  Configuring system locale."
Nicolas Kovacs's avatar
Nicolas Kovacs committed
134
  localectl set-locale LANG=en_US.UTF-8
Microlinux's avatar
Microlinux committed
135
136
  sleep ${SLEEP}
  # Set console resolution
137
  echo "  Configuring console resolution."
Microlinux's avatar
Microlinux committed
138
139
140
141
  sed -i -e 's/rhgb quiet/nomodeset quiet vga=791/g' /etc/default/grub
  sleep ${SLEEP}
  if [ -f /boot/grub2/grub.cfg ]
  then
142
    echo "  Updating bootloader on BIOS system."
Microlinux's avatar
Microlinux committed
143
    grub2-mkconfig -o /boot/grub2/grub.cfg >> ${LOG} 2>&1
144
  elif [ -f /boot/efi/EFI/redhat/grub.cfg ]
Microlinux's avatar
Microlinux committed
145
  then
146
    echo "  Updating bootloader on UEFI system."
147
    grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg >> ${LOG} 2>&1
Microlinux's avatar
Microlinux committed
148
  fi
149
  echo
Microlinux's avatar
Microlinux committed
150
151
}

Microlinux's avatar
Microlinux committed
152
configure_repos_el7() {
153
154
  echo "  === Package repository configuration ==="
  echo
Microlinux's avatar
Microlinux committed
155
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
156
  echo "  Configuring package repository: [ol7-latest]"
157
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
158
  echo "  Configuring package repository: [ol7-optional_latest]"
159
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
160
  echo "  Configuring package repository: [ol7-addons]"
Microlinux's avatar
Microlinux committed
161
162
  cat ${CWD}/el7/yum.repos.d/oracle-linux-ol7.repo > \
    /etc/yum.repos.d/oracle-linux-ol7.repo
Microlinux's avatar
Microlinux committed
163
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
164
  echo "  Configuring package repository: [ol7-uekr6]"
Microlinux's avatar
Microlinux committed
165
166
  cat ${CWD}/el7/yum.repos.d/uek-ol7.repo > /etc/yum.repos.d/uek-ol7.repo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
167
168
169
  echo "  Configuring package repository: [ol7-kvm]"
  cat ${CWD}/el7/yum.repos.d/virt-ol7.repo > /etc/yum.repos.d/virt-ol7.repo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
170
  echo "  Configuring package repository: [ol7-software-collections]"
Microlinux's avatar
Microlinux committed
171
172
173
  yum -y install oracle-softwarecollection-release-el7 >> ${LOG} 2>&1
  cat ${CWD}/el7/yum.repos.d/oracle-softwarecollection-ol7.repo > \
    /etc/yum.repos.d/oracle-softwarecollection-ol7.repo
Microlinux's avatar
Microlinux committed
174
  echo "  Configuring package repository: [ol7-epel]"
Microlinux's avatar
Microlinux committed
175
176
177
  yum -y install oracle-epel-release-el7 >> ${LOG} 2>&1
  cat ${CWD}/el7/yum.repos.d/oracle-epel-ol7.repo > \
    /etc/yum.repos.d/oracle-epel-ol7.repo
microlinux's avatar
microlinux committed
178
  echo "  Configuring package repository: [el7-software-collections]"
179
180
181
  yum -y install ${SCLRPM[1]} >> ${LOG} 2>&1
  cat ${CWD}/el7/yum.repos.d/CentOS-SCLo-scl-rh.repo > \
    /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
microlinux's avatar
microlinux committed
182
  echo "  Configuring package repository: [el7-software-collections-extras]"
183
184
185
  yum -y install ${SCLRPM[2]} >> ${LOG} 2>&1
  cat ${CWD}/el7/yum.repos.d/CentOS-SCLo-scl.repo > \
    /etc/yum.repos.d/CentOS-SCLo-scl.repo
186
187
188
189
  echo "  Configuring package repository: [el7-epel]"
  yum -y install ${EPELRPM} >> ${LOG} 2>&1
  cat ${CWD}/el7/yum.repos.d/epel.repo > /etc/yum.repos.d/epel.repo
  rm -f /etc/yum.repos.d/epel-testing.repo
Microlinux's avatar
Microlinux committed
190
  echo "  Configuring repository: [el7-lynis]"
Microlinux's avatar
Microlinux committed
191
192
193
  rpm --import ${CISOFY}/keys/cisofy-software-rpms-public.key >> ${LOG} 2>&1
  cat ${CWD}/el7/yum.repos.d/lynis.repo > /etc/yum.repos.d/lynis.repo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
194
  echo "  Configuring repository: [el7-icinga]"
Microlinux's avatar
Microlinux committed
195
196
197
198
  yum -y install ${ICINGA}/epel/icinga-rpm-release-7-latest.noarch.rpm >> ${LOG} 2>&1
  cat ${CWD}/el7/yum.repos.d/ICINGA-release.repo > /etc/yum.repos.d/ICINGA-release.repo
  rm -f /etc/yum.repos.d/ICINGA-snapshot.repo
  sleep ${SLEEP}
199
200
201
  # Install Yum-Priorities plugin
  if ! rpm -q yum-plugin-priorities > /dev/null 2>&1
  then
202
    echo "  Installing Yum-Priorities plugin."
203
204
    yum -y install yum-plugin-priorities >> ${LOG} 2>&1
  fi
205
  echo
Microlinux's avatar
Microlinux committed
206
207
}

Microlinux's avatar
Microlinux committed
208
configure_repos_el8() {
209
210
211
212
  echo "  === Package repository configuration ==="
  echo
  sleep ${SLEEP}
  echo "  Configuring package repository: [ol8_baseos_latest]"
Microlinux's avatar
Microlinux committed
213
  sleep ${SLEEP}
214
  echo "  Configuring package repository: [ol8_appstream]"
Microlinux's avatar
Microlinux committed
215
216
  cat ${CWD}/el8/yum.repos.d/oracle-linux-ol8.repo > /etc/yum.repos.d/oracle-linux-ol8.repo
  sleep ${SLEEP}
217
  echo "  Configuring package repository: [uekr6]"
Microlinux's avatar
Microlinux committed
218
219
  cat ${CWD}/el8/yum.repos.d/uek-ol8.repo > /etc/yum.repos.d/uek-ol8.repo
  sleep ${SLEEP}
220
  echo "  Configuring package repository: [ol8_epel]"
Microlinux's avatar
Microlinux committed
221
222
223
  yum -y install oracle-epel-release-el8 >> ${LOG} 2>&1
  cat ${CWD}/el8/yum.repos.d/oracle-epel-ol8.repo > \
    /etc/yum.repos.d/oracle-epel-ol8.repo
Microlinux's avatar
Microlinux committed
224
225
226
227
228
  sleep ${SLEEP}
  echo "  Configuring repository: [lynis]"
  rpm --import ${CISOFY}/keys/cisofy-software-rpms-public.key >> ${LOG} 2>&1
  cat ${CWD}/el8/yum.repos.d/lynis.repo > /etc/yum.repos.d/lynis.repo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
229
230
231
232
233
  echo "  Configuring repository: [icinga]"
  yum -y install ${ICINGA}/epel/icinga-rpm-release-8-latest.noarch.rpm >> ${LOG} 2>&1
  cat ${CWD}/el8/yum.repos.d/ICINGA-release.repo > /etc/yum.repos.d/ICINGA-release.repo
  rm -f /etc/yum.repos.d/ICINGA-snapshot.repo
  sleep ${SLEEP}
234
  echo
Microlinux's avatar
Microlinux committed
235
236
}

Microlinux's avatar
Microlinux committed
237
update_system() {
238
239
240
  echo "  === Update system ==="
  echo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
241
  if ! rpm -q ${DELTARPM[${VERSION}]} > /dev/null 2>&1
Microlinux's avatar
Microlinux committed
242
  then
243
    echo "  Enabling Delta RPM."
Microlinux's avatar
Microlinux committed
244
    yum -y install ${DELTARPM[${VERSION}]} >> ${LOG} 2>&1
Microlinux's avatar
Microlinux committed
245
246
  fi
  # Update system.
247
  echo "  Performing system update."
Microlinux's avatar
Microlinux committed
248
  sleep ${SLEEP}
249
  echo "  This might take a moment..."
Microlinux's avatar
Microlinux committed
250
  yum -y update >> ${LOG} 2>&1
251
  echo
Microlinux's avatar
Microlinux committed
252
253
}

Microlinux's avatar
Microlinux committed
254
install_extras() {
255
256
257
258
  echo "  === Install extra packages ==="
  echo
  sleep ${SLEEP}
  echo "  Fetching missing packages from Core package group." 
Microlinux's avatar
Microlinux committed
259
  yum -y group mark remove "Core" >> ${LOG} 2>&1
Microlinux's avatar
Microlinux committed
260
  yum -y group install "Core" >> ${LOG} 2>&1
261
  echo "  Core package group installed on the system."
Microlinux's avatar
Microlinux committed
262
  sleep ${SLEEP}
263
  echo "  Installing Base package group."
Microlinux's avatar
Microlinux committed
264
  sleep ${SLEEP}
265
  echo "  This might take a moment..."
Microlinux's avatar
Microlinux committed
266
  yum -y group mark remove "Base" >> ${LOG} 2>&1
Microlinux's avatar
Microlinux committed
267
  yum -y group install "Base" >> ${LOG} 2>&1
268
  echo "  Base package group installed on the system."
Microlinux's avatar
Microlinux committed
269
  sleep ${SLEEP}
270
  echo "  Installing some additional packages."
Microlinux's avatar
Microlinux committed
271
272
273
274
275
  sleep ${SLEEP}
  for PACKAGE in ${EXTRA}
  do
    if ! rpm -q ${PACKAGE} > /dev/null 2>&1
    then
276
      echo "  Installing package: ${PACKAGE}"
Microlinux's avatar
Microlinux committed
277
278
279
      yum -y install ${PACKAGE} >> ${LOG} 2>&1
    fi
  done
280
281
282
  echo "  Additional packages installed on the system."
  echo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
283
284
}

Microlinux's avatar
Microlinux committed
285
remove_cruft() {
286
287
288
289
  echo "  === Remove useless packages ==="
  echo
  sleep ${SLEEP}
  echo "  Removing unneeded components from the system."
Microlinux's avatar
Microlinux committed
290
291
292
293
294
  sleep ${SLEEP}
  for PACKAGE in ${CRUFT}
  do
    if rpm -q ${PACKAGE} > /dev/null 2>&1
    then
295
      echo "  Removing package: ${PACKAGE}"
Microlinux's avatar
Microlinux committed
296
297
298
      yum -y remove ${PACKAGE} >> ${LOG} 2>&1
      if [ "${?}" -ne 0 ]
        then
299
        echo "  Could not remove package: ${PACKAGE}" >&2
Microlinux's avatar
Microlinux committed
300
301
302
303
        exit 1
      fi
    fi
  done
304
305
306
  echo "  Unneeded components removed from the system."
  echo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
307
308
}

309
configure_logs() {
310
311
312
  echo "  === Configure logging ==="
  echo
  sleep ${SLEEP}
313
314
315
316
317
  # Admin user can access system logs
  if [ ! -z "${ADMIN}" ]
  then
    if getent group systemd-journal | grep ${ADMIN} > /dev/null 2>&1
    then
318
      echo "  Admin user ${ADMIN} is already a member of the systemd-journal group."
319
    else
320
      echo "  Adding admin user ${ADMIN} to systemd-journal group."
321
322
323
      usermod -a -G systemd-journal ${ADMIN}
    fi
  fi
324
325
  echo
  sleep ${SLEEP}
326
327
}

Microlinux's avatar
Microlinux committed
328
disable_ipv6() {
329
330
331
  echo "  === Use IPv4 only ==="
  echo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
332
  # Disable IPv6
333
  echo "  Disabling IPv6."
Microlinux's avatar
Microlinux committed
334
335
  sleep ${SLEEP}
  cat ${CWD}/el${VERSION}/sysctl.d/disable-ipv6.conf > /etc/sysctl.d/disable-ipv6.conf
Nicolas Kovacs's avatar
Nicolas Kovacs committed
336
  sysctl -p --load /etc/sysctl.d/disable-ipv6.conf >> ${LOG} 2>&1
Microlinux's avatar
Microlinux committed
337
338
339
  # Reconfigure SSH 
  if [ -f /etc/ssh/sshd_config ]
  then
340
    echo "  Configuring SSH server for IPv4 only."
Microlinux's avatar
Microlinux committed
341
342
343
344
345
346
347
    sleep ${SLEEP}
    sed -i -e 's/#AddressFamily any/AddressFamily inet/g' /etc/ssh/sshd_config
    sed -i -e 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g' /etc/ssh/sshd_config
  fi
  # Reconfigure Postfix
  if [ -f /etc/postfix/main.cf ]
  then
348
    echo "  Configuring Postfix server for IPv4 only."
Microlinux's avatar
Microlinux committed
349
    sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
350
    sed -i -e 's/# Enable IPv4, and IPv6 if supported/# Enable IPv4/g' /etc/postfix/main.cf
Microlinux's avatar
Microlinux committed
351
352
353
354
    sed -i -e 's/inet_protocols = all/inet_protocols = ipv4/g' /etc/postfix/main.cf
    systemctl restart postfix
  fi
  # Rebuild initrd
355
  echo "  Rebuilding initial ramdisk."
Nicolas Kovacs's avatar
Nicolas Kovacs committed
356
  dracut -f -v >> ${LOG} 2>&1
357
  echo
Microlinux's avatar
Microlinux committed
358
359
}

Microlinux's avatar
Microlinux committed
360
configure_sudo() {
361
362
363
  echo "  === Configure sudo ==="
  echo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
364
365
366
  # Configure persistent password for sudo.
  if grep timestamp_timeout /etc/sudoers > /dev/null 2>&1
  then
367
    echo "  Persistent password for sudo already configured."
Microlinux's avatar
Microlinux committed
368
  else
369
    echo "  Configuring persistent password for sudo."
Microlinux's avatar
Microlinux committed
370
371
372
373
374
    sleep ${SLEEP}
    echo >> /etc/sudoers
    echo "# Timeout" >> /etc/sudoers
    echo "Defaults timestamp_timeout=-1" >> /etc/sudoers
  fi
375
376
  echo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
377
}
Microlinux's avatar
Microlinux committed
378

Microlinux's avatar
Microlinux committed
379
reset_system() {
380
381
382
  echo "  === Restore enhanced base system ==="
  echo
  sleep ${SLEEP}
Microlinux's avatar
Microlinux committed
383
  # Remove all packages that are not part of the enhanced base system.
384
  echo "  Stripping system."
Microlinux's avatar
Microlinux committed
385
386
387
388
389
390
391
392
  local TMP="/tmp"
  local PKGLIST="${TMP}/pkglist"
  local PKGINFO="${TMP}/pkg_base"
  rpm -qa --queryformat '%{NAME}\n' | sort > ${PKGLIST}
  PACKAGES=$(egrep -v '(^\#)|(^\s+$)' $PKGLIST)
  rm -rf ${PKGLIST} ${PKGINFO}
  mkdir ${PKGINFO}
  unset REMOVE
393
  echo "  Creating database."
Microlinux's avatar
Microlinux committed
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
  for PACKAGE in ${BASE}
  do
    touch ${PKGINFO}/${PACKAGE}
  done
  for PACKAGE in ${PACKAGES}
  do
    if [ -r ${PKGINFO}/${PACKAGE} ]
    then
      continue
    else
      REMOVE="${REMOVE} ${PACKAGE}"
    fi
  done
  if [ ! -z "${REMOVE}" ]
  then
    for PACKAGE in ${REMOVE}
    do
      if rpm -q ${PACKAGE} > /dev/null 2>&1
      then
413
        echo "  Removing package: ${PACKAGE}"
Microlinux's avatar
Microlinux committed
414
415
416
417
        yum -y remove ${PACKAGE} >> ${LOG} 2>&1
      fi
    done
  fi
418
  echo
Microlinux's avatar
Microlinux committed
419
420
421
422
423
424
  configure_repos_el${VERSION}
  install_extras
  remove_cruft
  rm -rf ${PKGLIST} ${PKGINFO}
}

Microlinux's avatar
Microlinux committed
425
426
427
# Make sure the script is being executed with superuser privileges.
if [[ "${UID}" -ne 0 ]]
then
428
429
  echo "  Please run with sudo or as root." >&2
  echo
Microlinux's avatar
Microlinux committed
430
431
432
433
434
435
436
437
438
439
440
441
442
443
  exit 1
fi

# Check parameters.
if [[ "${#}" -ne 1 ]]
then
  usage
  exit 1
fi
OPTION="${1}"
case "${OPTION}" in
  --shell)
    configure_shell
    ;;
Microlinux's avatar
Microlinux committed
444
  --repos)
445
    configure_repos_el${VERSION}
Microlinux's avatar
Microlinux committed
446
    ;;
Microlinux's avatar
Microlinux committed
447
448
449
  --fresh)
    update_system
    ;;
Microlinux's avatar
Microlinux committed
450
451
452
  --extra) 
    install_extras
    ;;
Microlinux's avatar
Microlinux committed
453
454
455
  --strip) 
    remove_cruft
    ;;
456
457
458
  --logs) 
    configure_logs
    ;;
Microlinux's avatar
Microlinux committed
459
460
461
  --ipv4) 
    disable_ipv6
    ;;
Microlinux's avatar
Microlinux committed
462
463
464
  --sudo) 
    configure_sudo
    ;;
Microlinux's avatar
Microlinux committed
465
466
467
468
469
470
471
472
473
474
  --setup) 
    configure_shell
    configure_repos_el${VERSION}
    update_system
    install_extras
    remove_cruft
    configure_logs
    disable_ipv6
    configure_sudo
    ;;
Microlinux's avatar
Microlinux committed
475
476
477
  --reset) 
    reset_system
    ;;
Microlinux's avatar
Microlinux committed
478
479
480
481
482
483
484
485
486
487
488
  --help) 
    usage
    exit 0
    ;;
  ?*) 
    usage
    exit 1
esac

exit 0