howdy/debian/prerm
2018-04-12 23:45:52 +02:00

36 lines
1,002 B
Python
Executable file

#!/usr/bin/env python3
# Executed on deinstallation
# Completely remove howdy from the system
def col(id):
if id == 1: return "\033[32m"
if id == 2: return "\033[33m"
if id == 3: return "\033[31m"
return "\033[0m"
# Import required modules
import subprocess
# Remove files and symlinks
try:
subprocess.call(["rm /usr/local/bin/howdy"], shell=True)
except e:
print("Can't remove executable")
try:
subprocess.call(["rm /usr/share/bash-completion/completions/howdy"], shell=True)
except e:
print("Can't remove autocompletion script")
try:
subprocess.call(["rm -rf /lib/security/howdy"], shell=True)
except e:
# This error is normal
pass
# Remove face_recognition and dlib
subprocess.call(["pip3 uninstall face_recognition face_recognition_models dlib -y --no-cache-dir"], shell=True)
# Print a tearbending message
print(col(2) + """
There are still lines in /etc/pam.d/common-auth that can't be removed automatically
Run "nano /etc/pam.d/common-auth" to remove them by hand\
""" + col(0))