~philbull/+junk/ubuntu-doc-dev

« back to all changes in this revision

Viewing changes to welcome-centre-admin.py

  • Committer: Phil Bull
  • Date: 2007-11-12 11:04:17 UTC
  • Revision ID: philbull@gmail.com-20071112110417-451wj6fjks2fmrw5
Added files to branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
import os
 
4
import sys
 
5
 
 
6
# Check if root
 
7
is_root = False
 
8
a,b,c = os.popen3('whoami')
 
9
for line in b.readlines():
 
10
        if ("root" not in line):
 
11
                print "You do not have root privileges. Please run this program as root."
 
12
                sys.exit()
 
13
 
 
14