#!/usr/bin/env sh

uninstall_zsh_user() {
 local zsh_comp_dir="${HOME}"/.local/share/zsh/site-functions
 rm "${zsh_comp_dir}"/_clever || true
}

uninstall_zsh_root() {
 rm /usr/share/zsh/site-functions/_clever || true
}

uninstall_bash_root() {
 rm /usr/share/bash-completion/completions/clever || true
}

uninstall() {
 if [[ "$USER" = "root" ]]; then
  if which zsh &>/dev/null; then
    uninstall_zsh_root
  fi
  if which bash &>/dev/null; then
    uninstall_bash_root
  fi
 else
  if which zsh &>/dev/null; then
    uninstall_zsh_user
  fi
 fi
}

uninstall

#!/usr/bin/env sh

uninstall_zsh() {
 local zsh_comp_dir="${HOME}"/.local/share/zsh/site-functions
 rm "${zsh_comp_dir}"/_clever || true
}

uninstall() {
 if which zsh &>/dev/null; then
   uninstall_zsh
 fi
}

uninstall

--- 
+++ 
@@ -1,13 +1,30 @@
 #!/usr/bin/env sh
 
-uninstall_zsh() {
+uninstall_zsh_user() {
  local zsh_comp_dir="${HOME}"/.local/share/zsh/site-functions
  rm "${zsh_comp_dir}"/_clever || true
 }
 
+uninstall_zsh_root() {
+ rm /usr/share/zsh/site-functions/_clever || true
+}
+
+uninstall_bash_root() {
+ rm /usr/share/bash-completion/completions/clever || true
+}
+
 uninstall() {
- if which zsh &>/dev/null; then
-   uninstall_zsh
+ if [[ "$USER" = "root" ]]; then
+  if which zsh &>/dev/null; then
+    uninstall_zsh_root
+  fi
+  if which bash &>/dev/null; then
+    uninstall_bash_root
+  fi
+ else
+  if which zsh &>/dev/null; then
+    uninstall_zsh_user
+  fi
  fi
 }
 
Uninstall bash & zsh completion scripts when installed as root
