Created
January 5, 2015 10:42
-
-
Save orf/2f37fb82fd995fc29048 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if sys.platform.startswith('linux'): | |
| if os.geteuid() == 0: | |
| print 'DO. NOT. RUN. AS. ROOT.' | |
| sys.exit() | |
| else: | |
| print 'Welcome to Contrl, Linux user!' | |
| elif sys.platform.startswith('darwin'): | |
| if os.geteuid() == 0: | |
| print 'DO. NOT. RUN. AS. ROOT.' | |
| sys.exit() | |
| else: | |
| print 'Welcome to Contrl, Mac user!' | |
| # by the power of greyskull | |
| if sys.platform.startswith('linux') or sys.platform.startswith("darwin"): | |
| if os.geteuid() == 0: | |
| print 'DO. NOT. RUN. AS. ROOT.' | |
| sys.exit() | |
| else: | |
| print 'Welcome to Contrl, {0} user!'.format(get_system_name()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment