starting work on env setup script

This commit is contained in:
staticsafe 2012-01-05 12:39:46 -05:00
parent 0ada6cb233
commit 93856e6bc7
1 changed files with 48 additions and 0 deletions

48
envsetup.py Normal file
View File

@ -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()