summaryrefslogtreecommitdiffstats
path: root/firstaidkit
diff options
context:
space:
mode:
authorJoel Andres Granados <jgranado@redhat.com>2008-02-20 11:44:00 +0100
committerJoel Andres Granados <jgranado@redhat.com>2008-02-20 11:44:00 +0100
commit49b035b122874fc9038464d220caeef586d9574c (patch)
tree30ccd424b64eb0d18f886100a85e824702f02cab /firstaidkit
parent7948dd506910f324b1b31c894e5048cb037a2135 (diff)
downloadfirstaidkit-49b035b122874fc9038464d220caeef586d9574c.tar.gz
firstaidkit-49b035b122874fc9038464d220caeef586d9574c.tar.xz
firstaidkit-49b035b122874fc9038464d220caeef586d9574c.zip
Efective user must be root.
Diffstat (limited to 'firstaidkit')
-rwxr-xr-xfirstaidkit13
1 files changed, 11 insertions, 2 deletions
diff --git a/firstaidkit b/firstaidkit
index dda060e..fb5c6bd 100755
--- a/firstaidkit
+++ b/firstaidkit
@@ -16,8 +16,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-import sys
-import getopt
+import sys, getopt, os
from threading import Thread
from pyfirstaidkit import Tasker
from pyfirstaidkit import Config
@@ -64,8 +63,18 @@ if __name__=="__main__":
params, rest = getopt.getopt(sys.argv[1:], "ftc:r:vl:x:F:g:P:h",
["flow", "task", "config=", "root=", "verbose", "log=", "exclude=",
"flag=", "gui=", "plugin-path=", "print-config", "help"])
+
+ #
+ # Preliminary checks before we parse the options.
+ #
if len(params) == 0:
Flags.main_help = True
+ if os.geteuid() != 0:
+ # Might want to add the "I want to execute anyway" option.
+ print "\nYou must be root to execute firstaidkit.\n"
+ usage(sys.argv[0])
+ sys.exit(1)
+
for key,val in params:
if key in ("-t", "--task"):
Config.operation.mode = "task"