Skip to content

Instantly share code, notes, and snippets.

@gesquive
gesquive / self-update-script.py
Last active November 3, 2024 09:35
Stick this in a python script to self update the script from an online source
def update(dl_url, force_update=False):
"""
Attempts to download the update url in order to find if an update is needed.
If an update is needed, the current script is backed up and the update is
saved in its place.
"""
import urllib
import re
from subprocess import call
def compare_versions(vA, vB):
#! /usr/bin/python
# Script to set network parameters from 'vmtoolsd --cmd "info-get guestinfo.ovfenv"'. It is designed for SLES 11 SP3
# Author: Willian Antunes
# Date of creation: September 03, 2014
import os, sys, time, subprocess, re
from xml.dom.minidom import parseString
def findXmlSection(dom, sectionName):
sections = dom.getElementsByTagName(sectionName)