-
Notifications
You must be signed in to change notification settings - Fork 81
/
fedorautils
executable file
·85 lines (72 loc) · 3.21 KB
/
fedorautils
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
#!/bin/bash
# Fedora Utils lets you install codecs and additional software,
# fix problems, tweak and cleanup your system,
# view system information and much more with just few clicks.
#
# Copyright (C) 2012 Satyajit sahoo
#
# License: GNU General Public License 3 <http://www.gnu.org/licenses/gpl-3.0.html>
# Author: Satyajit Sahoo <satyajit.happy@gmail.com>
# Site: Project Page <http://fedorautils.sorceforge.net>
#
# This script benefits both for codes and ideas from
# AutoPlus by dangermouse <http://www.dnmouse.org/autoten/>
# easyLife by dulinux <http://easylifeproject.org>
#
# I'm grateful to dangermouse for providing RPM pacakge and pointing out the bugs & mistakes
# Thanks to Andrew <http://webupd8.org> for testing and publishing it in his blog
# Special credits to Valdur Kana <valdur55@gmail.com> for dynamic way of creating menus
# And of course, all those users who reported bugs
# Declare Variables
PROGRAM="Fedora Utils"
VERSION="2.0.7"
USER="$(logname)"
REBOOTREQUIRED="NO"
FORCE="NO"
FORCEDISTRO="NO"
ERRORS="0"
ARG="$1"
HOMEDIR=`awk -F: -v v="$(logname)" '{if ($1==v) print $6}' /etc/passwd`
SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Configuration
LIBS="$SCRIPTDIR/lib/*.sh" # Provides core functionality, change only if you know what are you doing
MODULES="$SCRIPTDIR/modules/*.sh" # Provides the main menu module
PLUGINS="$SCRIPTDIR/plugins/*.sh" # The directory where are containing all the plugins
WORKINGDIR="/tmp/fedorautils" # A temporary directory where everything is done, automatically created as needed
LOCKFILE="/var/run/fedorautils.pid" # The lockfile used to prevent running of multiple instances
LOGFILE="/var/log/fedorautils.log" # Outputs will be redirected to this file if logging is enabled
KEEPLOG="NO" # If you want to enable logging, change "NO" to "YES"
FORCE="NO" # If you want to force redownload of files, change "NO" to "YES"
FORCEDISTRO="NO" # If you want to run the script with unsupported distro, change "NO" to "YES"
KEEPBACKUP="YES" # If you don't want to backup previous configurations, change "YES" to "NO"
KEEPDOWNLOADS="YES" # If you don't intend to save downloads, change "YES" to "NO"
DOWNLOADSDIR="$HOMEDIR/FedoraUtils" # All downloaded files are saved in this directory
# Set Colors
BOLD="\033[1;10m"
RED="\033[0;31m"
REDBOLD="\033[1;31m"
GREEN="\033[0;32m"
GREENBOLD="\033[1;32m"
YELLOW="\033[0;33m"
YELLOWBOLD="\033[1;33m"
BLUE="\033[0;34m"
BLUEBOLD="\033[1;34m"
ENDCOLOR="\033[0m"
# Source functions
for lib in $LIBS; do source "$lib"; done
for module in $MODULES; do source "$module"; done
for plug in $PLUGINS; do source "$plug"; done
# Additional Parameters
trap Terminate INT
# Run the Program
CheckArgs # Check any supplied arguments and run the suitable function
ShowLicense # Show the License when starting the script
CheckRoot # Check if running as root
EnableLog # Enable logging if --enable-log argument is given
CheckLock # Check if any other instances running and exit
CheckReq # Check the minimum requirements for running the script
Initialize # Initialize the script
Main # Show the main menu
Complete # Do all the clean up and other stuff when all tasks are complete
# Please report bugs at <http://github.com/satya164/fedorautils/issues>
# End of the Script