How do I get python to run sudo openvpn --cd /etc/openvpn --config client.ovpn
I'm trying the following at the minute without success
vpnfile2 = '/etc/init.d/openvpn'
cfgFile = 'client.ovpn'
os.system('sudo \"" + vpnFile2 + "\" --cd \"" + vpnpath + "\" --config \"" + cfgFile + "\"')
subprocess.call(['sudo', 'cat', '/etc/shadow'])
:) Works ok on Karmic by the way! Perhaps some versions of sudo don't