From a01549d081f199c25d923751db4e88718c371612 Mon Sep 17 00:00:00 2001 From: Tulili Date: Thu, 1 Jun 2023 12:58:43 -0300 Subject: [PATCH] feat: nix uninstaller for ublue-os systems (#93) --- usr/bin/ublue-nix-uninstall | 86 +++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100755 usr/bin/ublue-nix-uninstall diff --git a/usr/bin/ublue-nix-uninstall b/usr/bin/ublue-nix-uninstall new file mode 100755 index 0000000..42e295d --- /dev/null +++ b/usr/bin/ublue-nix-uninstall @@ -0,0 +1,86 @@ +#!/bin/bash +VERBOSITY="${VERBOSITY:-0}" +SUDO_PROGRAM="${SUDO_PROGRAM:-sudo}" +USER_WARNING="${USER_WARNING:-1}" +[ "$VERBOSITY" = "1" ] && set -x +set -uo pipefail + +function log { + LEVEL=$1 + shift + echo "[${LEVEL}]" $@ >&2 +} + +if [ "$EUID" = 0 ] ; then + log WARNING "Do not run this command as root, as it won't delete proper files in your system" + exit +fi + +if [ "$USER_WARNING" = 1 ] ; then + cat <