import os import platform import random import re import string import sys
print(''' -------------------------------- TeamViewer 14 ID Changer for MAC OS Version: 0.2 2019 -------------------------------- ''')
if platform.system() != "Darwin": print("This script can be run only on MAC OS.") sys.exit()
if os.geteuid() != 0: print("This script must be run form root.") sys.exit()
if"SUDO_USER"in os.environ: USERNAME = os.environ["SUDO_USER"] if USERNAME == "root": print("Can not find user name. Run this script via sudo from regular user") sys.exit() else: print("Can not find user name. Run this script via sudo from regular user") sys.exit()
def listdir_fullpath(d): return [os.path.join(d, f) for f in os.listdir(d)]
for file in listdir_fullpath(HOMEDIRLIB): if'teamviewer'in file.lower(): CONFIGS.append(file)
for file in listdir_fullpath(GLOBALLIB): if'teamviewer'in file.lower(): CONFIGS.append(file)
if not CONFIGS: print(''' There is no TemViewer configs found. Maybe you have deleted it manualy or never run TeamViewer after installation. Nothing to delete. ''') else: # Delete config files print("Configs found:\n") for file in CONFIGS: print(file) print(''' This files will be DELETED permanently. All TeamViewer settings will be lost ''') raw_input("Press Enter to continue or CTR+C to abort...")
for file in CONFIGS: try: os.remove(file) except: print("Cannot delete config files. Permission denied?") sys.exit() print("Done.")