From 93856e6bc7bd1b4f49cc1f88a9aefb1bdb6e775d Mon Sep 17 00:00:00 2001 From: staticsafe Date: Thu, 5 Jan 2012 12:39:46 -0500 Subject: [PATCH] starting work on env setup script --- envsetup.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 envsetup.py diff --git a/envsetup.py b/envsetup.py new file mode 100644 index 0000000..9ed1f7c --- /dev/null +++ b/envsetup.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +#Personal environment setup script + +import os +from subprocess import call +import platform +import re +import urllib2 + +#global vars +vimrcurl = "https://raw.github.com/staticsafe/dotfiles/master/.vimrc" +zshrcurl = "https://raw.github.com/staticsafe/dotfiles/master/.zshrc" +tmuxurl = "https://raw.github.com/staticsafe/dotfiles/master/.tmux.conf" + +def rootcheck(): + #rootcheck + uid = os.getuid() + if uid != 0: + print 'This script must be run as root or sudo if you have it!' + raise SystemExit + +def main(): + #homedircheck + homedir = os.environ['HOME'] + currentdir = os.getcwd() + + if currentdir != homedir: + os.chdir(homedir) + else: + print "Home directory check : PASSED!'" + #distrocheck + userdistro = platform.linux_distribution() + + if userdistro[0] == "Fedora": + + elif userdistro[0] == "debian": + + elif userdistro[0] == "Arch" or os.path.isfile("/etc/arch-release") == True: + + elif userdistro[0] == "Ubuntu": + + else: + print "This script is not supported for your distro, exiting." + raise SystemExit + +if __name__ == "__main__": + main() \ No newline at end of file