Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import os
- import sys
- from art import *
- from colorama import init, Fore, Back, Style
- import time
- def root_user():
- if os.geteuid() != 0:
- init()
- print (Fore.YELLOW + "Este Script solo lo puedes ejecutar con usuario root")
- init(autoreset=True)
- sys.exit(1)
- else:
- print("Starting")
- def show_ip():
- time.sleep(1)
- print(Fore.GREEN + "Mostrando Lineas donde esta la anterior IP")
- time.sleep(1)
- print("..............................................")
- ipprint = os.system("cat client.ovpn | grep remote ")
- print("..............................................")
- init(autoreset=True)
- def Cambia_IP():
- time.sleep(1)
- print("Copia la IP mostra arriba")
- ip_old = raw_input("Introduce la antigua direccion ip: ")
- time.sleep(1)
- ip = raw_input("Introduce la nueva direccion ip: ")
- time.sleep(1)
- print ("Comando SET ejecutado...")
- comando = os.system("sed -i 's/{0}/{1}/g' client.ovpn".format(ip_old, ip))
- def conexion():
- time.sleep(1)
- print(Fore.RED + "Conectando a AWS Openvpn")
- time.sleep(1)
- print("..............................................\n\n")
- connect = os.system("openvpn --config client.ovpn")
- root_user()
- show_ip()
- Cambia_IP()
- conexion()
Add Comment
Please, Sign In to add comment