Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #This is the Clockwork PC post-installation Ubuntu customisation script
- import os
- #Install Xcowsay
- #os.system("sudo apt-get install xcowsay")
- #Create personalised folders
- homeFolder = os.getenv("HOME")
- binFolder = homeFolder + "/bin2"
- videoProjectsFolder = homeFolder + "/Videos/Projects"
- #Generate bin files
- cpcBash = binFolder + "/cpcbash2.sh"
- cpcBashName = "/cpcbash2.sh"
- os.mkdir(binFolder)
- open(cpcBash,"w").close()
- f = open(cpcBash,"a")
- f.write("""#!/bin/bash
- #~/bin/cpcbash.sh
- # Released under a GPLv3 Licence by Clockwork PC 2012
- # www.clockworkpc.com.au
- # You are entitled to the following four freedoms:
- # Freedom 0: To run this program for any purpose
- # Freedom 1: To study how this program works and change it to make it do what you wish
- # Freedom 2: To redistribute copies so you can help your neighbour
- # Freedom 3: To distribute copies of your modified version to others
- #BASH script to generate BASH scripts
- echo "What do you want to call your BASH script?"
- read RESPONSE
- echo "#!/bin/bash" | tee ~/bin/$RESPONSE.sh
- echo "#Filename:$RESPONSE.sh" | tee -a ~/bin/$RESPONSE.sh
- echo "#Released under a GPLv3 Licence by Clockwork PC" | tee -a ~/bin/$RESPONSE.sh
- sudo chmod +x ~/bin/$RESPONSE.sh
- sudo ln -s ~/bin/$RESPONSE.sh /usr/local/bin/$RESPONSE.sh
- sudo chmod +x /usr/local/bin/$RESPONSE.sh
- gedit ~/bin/$RESPONSE.sh
- """)
- f.close()
- os.system("chmod -v +x " + cpcBash)
- os.system("sudo ln -sv " + cpcBash + " /usr/local/bin" + cpcBashName)
- os.system("xcowsay 'Your Python script is ready!'")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement