From 1b6e17ebc1653a619fc015d4e02e74da5ef029a1 Mon Sep 17 00:00:00 2001 From: melihcelenk Date: Sun, 9 Nov 2025 19:30:53 +0300 Subject: [PATCH 1/4] - Add cleanup function to remove unnecessary files during installation in `get-mlh.sh`. - Update `mlh-docker.sh` to handle `sudo` usage by adding Docker binary resolution logic. - Enhance `README.md` with a note on using `sudo` for Docker commands. --- README.md | 2 ++ get-mlh.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ plugins/mlh-docker.sh | 20 +++++++++++++++----- 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a3d01d9..2fc26a2 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,8 @@ mlh docker in web # Select container [1-3]: 1 ``` +> **💡 Note:** Usually, you don't need `sudo` for `mlh docker in`. If your user is in the `docker` group, you can run it directly. If you need to use `sudo`, use: `sudo env "PATH=$PATH" mlh docker in ` or `sudo "$HOME/.local/bin/mlh" docker in ` + --- ### 📦 `linux` - Container Management diff --git a/get-mlh.sh b/get-mlh.sh index e5e8cf7..93516e3 100755 --- a/get-mlh.sh +++ b/get-mlh.sh @@ -96,6 +96,48 @@ ensure_local_bin_on_path() { grep -Fq "$line" "$PROFILE" 2>/dev/null || echo "$line" >>"$PROFILE" } +cleanup_unnecessary_files() { + green "Cleaning up unnecessary files…" + + # List of files/directories to remove (user doesn't need these) + local cleanup_items=( + "tests" + "CLAUDE.md" + "docs/BOOKMARK_ALIAS_GUIDE.md" + "docs/BOOKMARK_QUICK_REFERENCE.md" + "docs/RELEASE_NOTES_v1.5.0.md" + "docs/RELEASE_NOTES_v1.5.1.md" + "docs/assets" + ".git" + ".github" + "TODO.md" + ".gitignore" + ) + + # Keep docs/config/mlh.conf.example (needed for setup.sh) + # Keep README.md (useful for users) + # Keep LICENSE (required) + + for item in "${cleanup_items[@]}"; do + local item_path="${INSTALL_DIR}/${item}" + if [ -e "$item_path" ]; then + rm -rf "$item_path" + echo " Removed: $item" + fi + done + + # Clean up docs directory if it's now empty (except config/) + if [ -d "${INSTALL_DIR}/docs" ]; then + # Check if docs only contains config/ directory + local docs_contents + docs_contents=$(find "${INSTALL_DIR}/docs" -mindepth 1 -maxdepth 1 ! -name "config" | wc -l) + if [ "$docs_contents" -eq 0 ]; then + # Keep docs/config, but we can leave docs/ as is since it only has config/ + : + fi + fi +} + run_repo_setup() { green "Running repository setup…" chmod +x "${INSTALL_DIR}/setup.sh" || true @@ -105,6 +147,7 @@ run_repo_setup() { main() { green "Installing ${REPO_NAME} into ${INSTALL_DIR}" download_repo + cleanup_unnecessary_files ensure_local_bin_on_path run_repo_setup green "Done. Try:" diff --git a/plugins/mlh-docker.sh b/plugins/mlh-docker.sh index 94f0d5b..04ad463 100755 --- a/plugins/mlh-docker.sh +++ b/plugins/mlh-docker.sh @@ -65,8 +65,18 @@ case "$COMMAND" in ;; in) # Check if docker is available (only for actual commands) + # Try to find docker in common locations if not in PATH (for sudo usage) if ! command -v docker >/dev/null 2>&1; then - die "Docker is not installed or not in PATH" + # Check common docker locations + if [ -x "/usr/bin/docker" ]; then + DOCKER_CMD="/usr/bin/docker" + elif [ -x "/usr/local/bin/docker" ]; then + DOCKER_CMD="/usr/local/bin/docker" + else + die "Docker is not installed or not in PATH" + fi + else + DOCKER_CMD="docker" fi # Enter container by pattern @@ -77,7 +87,7 @@ in) PATTERN="$1" # Find matching containers (running only) - mapfile -t CONTAINERS < <(docker ps --format "{{.ID}}|{{.Names}}" | grep -i "$PATTERN" || true) + mapfile -t CONTAINERS < <("$DOCKER_CMD" ps --format "{{.ID}}|{{.Names}}" | grep -i "$PATTERN" || true) if [ ${#CONTAINERS[@]} -eq 0 ]; then die "No running containers found matching pattern: $PATTERN" @@ -88,7 +98,7 @@ in) CONTAINER_ID="${CONTAINERS[0]%%|*}" CONTAINER_NAME="${CONTAINERS[0]##*|}" echo "Entering container: $CONTAINER_NAME" - exec docker exec -it "$CONTAINER_ID" bash + exec "$DOCKER_CMD" exec -it "$CONTAINER_ID" bash else # Multiple matches - show menu echo "Multiple containers found matching '$PATTERN':" @@ -98,7 +108,7 @@ in) CONTAINER_NAME="${CONTAINERS[$i]##*|}" CONTAINER_ID="${CONTAINERS[$i]%%|*}" # Get container image and status - CONTAINER_INFO=$(docker ps --filter "id=$CONTAINER_ID" --format "{{.Image}} | {{.Status}}" | head -1) + CONTAINER_INFO=$("$DOCKER_CMD" ps --filter "id=$CONTAINER_ID" --format "{{.Image}} | {{.Status}}" | head -1) echo " $((i + 1)). $CONTAINER_NAME ($CONTAINER_INFO)" done @@ -117,7 +127,7 @@ in) echo "" echo "Entering container: $CONTAINER_NAME" - exec docker exec -it "$CONTAINER_ID" bash + exec "$DOCKER_CMD" exec -it "$CONTAINER_ID" bash fi ;; *) From a013ee980ea4e6a40634c0187ed5cfd9faeb1a9d Mon Sep 17 00:00:00 2001 From: melihcelenk Date: Sun, 9 Nov 2025 19:39:39 +0300 Subject: [PATCH 2/4] Update `test-mlh-docker.sh` with improved `ROOT_DIR` handling and flexible Docker command checks - Added fallback logic to set `ROOT_DIR` based on script location if not pre-set. - Enhanced test patterns to accept both direct Docker commands and variable-based equivalents (`DOCKER_CMD`). --- tests/test-mlh-docker.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/test-mlh-docker.sh b/tests/test-mlh-docker.sh index 4ee60e7..a13946b 100755 --- a/tests/test-mlh-docker.sh +++ b/tests/test-mlh-docker.sh @@ -1,10 +1,21 @@ #!/usr/bin/env bash # test-mlh-docker.sh - Test suite for mlh-docker.sh +# +# This file is sourced by the main test runner (./tests/test) +# It should NOT be executed directly # Disable strict mode for tests set +euo pipefail 2>/dev/null || true set +e +# ROOT_DIR should be set by test runner when sourced +# If not set, try to determine it from script location (for direct execution) +if [ -z "${ROOT_DIR:-}" ]; then + # Try to determine ROOT_DIR from script location + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + ROOT_DIR="$(dirname "$SCRIPT_DIR")" +fi + PLUGIN_SCRIPT="$ROOT_DIR/plugins/mlh-docker.sh" # ============================================================ @@ -108,7 +119,9 @@ fi # ============================================================ # Test 13: Script uses docker ps for listing containers -if grep -q "docker ps" "$PLUGIN_SCRIPT"; then +# Accept both direct 'docker ps' and variable-based 'DOCKER_CMD.*ps' patterns +# The script uses "$DOCKER_CMD" ps, so we check for DOCKER_CMD and ps together +if grep -qE '(docker ps|DOCKER_CMD.*ps)' "$PLUGIN_SCRIPT"; then print_test_result "Script uses 'docker ps' to list containers" "PASS" else print_test_result "Script uses 'docker ps' to list containers" "FAIL" @@ -136,7 +149,9 @@ else fi # Test 17: Script uses docker exec to enter containers -if grep -q "docker exec -it" "$PLUGIN_SCRIPT"; then +# Accept both direct 'docker exec -it' and variable-based 'DOCKER_CMD.*exec' patterns +# The script uses "$DOCKER_CMD" exec -it, so we check for DOCKER_CMD and exec together +if grep -qE '(docker exec -it|DOCKER_CMD.*exec)' "$PLUGIN_SCRIPT"; then print_test_result "Script uses 'docker exec -it' to enter" "PASS" else print_test_result "Script uses 'docker exec -it' to enter" "FAIL" From 7998a1bd35fcc53c19ed5ba050928d9f6beb328e Mon Sep 17 00:00:00 2001 From: melihcelenk Date: Sun, 9 Nov 2025 19:54:56 +0300 Subject: [PATCH 3/4] Clarify `.git` exclusion in `cleanup_unnecessary_files` and align formatting in `get-mlh.sh` --- get-mlh.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/get-mlh.sh b/get-mlh.sh index 93516e3..a74ffd2 100755 --- a/get-mlh.sh +++ b/get-mlh.sh @@ -98,8 +98,9 @@ ensure_local_bin_on_path() { cleanup_unnecessary_files() { green "Cleaning up unnecessary files…" - + # List of files/directories to remove (user doesn't need these) + # NOTE: .git is NOT removed - it's needed for git pull/update functionality local cleanup_items=( "tests" "CLAUDE.md" @@ -108,16 +109,16 @@ cleanup_unnecessary_files() { "docs/RELEASE_NOTES_v1.5.0.md" "docs/RELEASE_NOTES_v1.5.1.md" "docs/assets" - ".git" ".github" "TODO.md" ".gitignore" ) - + # Keep docs/config/mlh.conf.example (needed for setup.sh) # Keep README.md (useful for users) # Keep LICENSE (required) - + # Keep .git (needed for git pull/update functionality) + for item in "${cleanup_items[@]}"; do local item_path="${INSTALL_DIR}/${item}" if [ -e "$item_path" ]; then @@ -125,7 +126,7 @@ cleanup_unnecessary_files() { echo " Removed: $item" fi done - + # Clean up docs directory if it's now empty (except config/) if [ -d "${INSTALL_DIR}/docs" ]; then # Check if docs only contains config/ directory From a84a2db3717e2caa84e20d953d55031fae74d965 Mon Sep 17 00:00:00 2001 From: melihcelenk Date: Sun, 9 Nov 2025 20:21:54 +0300 Subject: [PATCH 4/4] Add uninstall functionality for MyLinuxHelper in `mlh.sh` and `mlh-version.sh` - Introduced `uninstall` option in the menu interface of `mlh.sh`. - Added `uninstall_mlh` function in `mlh-version.sh` for comprehensive cleanup: - Removes symlinks, configuration files, and PATH updates from `.bashrc` and `.profile`. - Ensures manual removal or confirmation where necessary. - Updated installation script to include comments for better file cleanup logic. - Improved menu option handling for seamless uninstall integration. --- get-mlh.sh | 1 + plugins/mlh-version.sh | 338 +++++++++++++++++++++++++++++++++++++++++ plugins/mlh.sh | 12 +- 3 files changed, 348 insertions(+), 3 deletions(-) diff --git a/get-mlh.sh b/get-mlh.sh index a74ffd2..8d1bcc5 100755 --- a/get-mlh.sh +++ b/get-mlh.sh @@ -148,6 +148,7 @@ run_repo_setup() { main() { green "Installing ${REPO_NAME} into ${INSTALL_DIR}" download_repo + # Cleanup unnecessary files (both git and tarball methods include development files) cleanup_unnecessary_files ensure_local_bin_on_path run_repo_setup diff --git a/plugins/mlh-version.sh b/plugins/mlh-version.sh index 106a192..9e13f1f 100755 --- a/plugins/mlh-version.sh +++ b/plugins/mlh-version.sh @@ -24,6 +24,9 @@ readonly INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/${GITHUB_REPO}/ma readonly CONFIG_DIR="${HOME}/.mylinuxhelper" readonly UPDATE_CONFIG="${CONFIG_DIR}/.update-config" readonly BASHRC="${HOME}/.bashrc" +readonly PROFILE="${HOME}/.profile" +readonly LOCAL_BIN="${HOME}/.local/bin" +readonly USR_LOCAL_BIN="/usr/local/bin" print_version() { echo "MyLinuxHelper v${VERSION}" @@ -40,11 +43,13 @@ Usage: mlh -v update Update to latest version mlh update Update to latest version mlh update -p Configure periodic updates + mlh --version uninstall Uninstall MyLinuxHelper Examples: mlh --version # Display: MyLinuxHelper v1.3.0 mlh --version update # Update to latest version from GitHub mlh update -p # Configure automatic periodic updates + mlh --version uninstall # Uninstall MyLinuxHelper (with confirmation) EOF } @@ -233,6 +238,335 @@ update_to_latest() { fi } +uninstall_mlh() { + echo "MyLinuxHelper Uninstall" + echo "=======================" + echo "" + echo "This will remove:" + echo " - ~/.mylinuxhelper directory" + echo " - Symlinks in ~/.local/bin (bookmark, bm, i, isjsonvalid, ll, linux, mlh, search)" + echo " - Symlinks in /usr/local/bin (if installed there)" + echo " - MyLinuxHelper entries from ~/.bashrc" + echo " - MyLinuxHelper entries from ~/.profile" + echo "" + echo "⚠️ WARNING: This action cannot be undone!" + echo "" + + read -rp "Are you sure you want to uninstall MyLinuxHelper? (type 'yes' to confirm): " CONFIRM + echo "" + + if [ "$CONFIRM" != "yes" ]; then + echo "Uninstall cancelled." + return 0 + fi + + echo "Uninstalling MyLinuxHelper..." + echo "" + + # Remove symlinks from ~/.local/bin + local symlinks=("bookmark" "i" "isjsonvalid" "ll" "linux" "mlh" "search") + local bookmark_alias="" + + # Check if bookmark alias exists in config + if [ -f "${CONFIG_DIR}/mlh.conf" ]; then + # shellcheck source=/dev/null + source "${CONFIG_DIR}/mlh.conf" 2>/dev/null || true + if [ -n "${BOOKMARK_ALIAS:-}" ]; then + bookmark_alias="$BOOKMARK_ALIAS" + fi + fi + + # Remove symlinks + for link in "${symlinks[@]}"; do + local link_path="${LOCAL_BIN}/${link}" + if [ -L "$link_path" ] || [ -f "$link_path" ]; then + rm -f "$link_path" + echo " Removed: $link_path" + fi + done + + # Remove bookmark alias symlink if exists + if [ -n "$bookmark_alias" ]; then + local alias_path="${LOCAL_BIN}/${bookmark_alias}" + if [ -L "$alias_path" ] || [ -f "$alias_path" ]; then + rm -f "$alias_path" + echo " Removed: $alias_path" + fi + fi + + # Remove symlinks from /usr/local/bin (if they exist and point to our plugins) + if [ -d "$USR_LOCAL_BIN" ] && command -v sudo >/dev/null 2>&1; then + for link in "${symlinks[@]}"; do + local link_path="${USR_LOCAL_BIN}/${link}" + if [ -L "$link_path" ]; then + local target + target="$(readlink -f "$link_path" 2>/dev/null || readlink "$link_path" 2>/dev/null || echo "")" + if echo "$target" | grep -q "MyLinuxHelper\|mylinuxhelper"; then + # shellcheck disable=SC2024 + if sudo rm -f "$link_path" 2>/dev/null; then + echo " Removed: $link_path" + fi + fi + fi + done + + # Remove bookmark alias from /usr/local/bin if exists + if [ -n "$bookmark_alias" ]; then + local alias_path="${USR_LOCAL_BIN}/${bookmark_alias}" + if [ -L "$alias_path" ]; then + local target + target="$(readlink -f "$alias_path" 2>/dev/null || readlink "$alias_path" 2>/dev/null || echo "")" + if echo "$target" | grep -q "MyLinuxHelper\|mylinuxhelper"; then + # shellcheck disable=SC2024 + if sudo rm -f "$alias_path" 2>/dev/null; then + echo " Removed: $alias_path" + fi + fi + fi + fi + fi + + # Remove entries from ~/.bashrc + if [ -f "$BASHRC" ]; then + local bashrc_backup + bashrc_backup="${BASHRC}.mlh-backup-$(date +%s)" + cp "$BASHRC" "$bashrc_backup" + local temp_bashrc + temp_bashrc="$(mktemp)" + + # Remove PATH export line + # shellcheck disable=SC2016 + local path_line='export PATH="$HOME/.local/bin:$PATH"' + if grep -Fq "$path_line" "$BASHRC" 2>/dev/null; then + # Check if this is the only PATH modification (safe to remove) + local path_count + path_count=$(grep -c 'export PATH=.*\.local/bin' "$BASHRC" 2>/dev/null || echo "0") + if [ "$path_count" -eq 1 ]; then + grep -vF "$path_line" "$BASHRC" >"$temp_bashrc" 2>/dev/null || cp "$BASHRC" "$temp_bashrc" + mv "$temp_bashrc" "$BASHRC" + echo " Removed PATH export from ~/.bashrc" + else + echo " Note: Multiple PATH entries found, not removing (manual cleanup may be needed)" + fi + fi + + # Remove mlh wrapper function (using Python for reliable multiline removal) + local mlh_marker="# MyLinuxHelper - mlh wrapper function" + if grep -Fq "$mlh_marker" "$BASHRC" 2>/dev/null; then + if command -v python3 >/dev/null 2>&1; then + python3 - "$BASHRC" "$mlh_marker" <<'PYEOF' +import sys + +bashrc_file = sys.argv[1] +marker = sys.argv[2] + +with open(bashrc_file, 'r') as f: + lines = f.readlines() + +output = [] +in_block = False +brace_count = 0 +skip_next_empty = False + +for i, line in enumerate(lines): + if not in_block: + if marker in line: + in_block = True + brace_count = 0 + skip_next_empty = (i > 0 and lines[i-1].strip() == '') + continue + else: + output.append(line) + else: + brace_count += line.count('{') - line.count('}') + if line.strip() == '}' and brace_count <= 0: + in_block = False + if skip_next_empty and output and output[-1].strip() == '': + output.pop() + continue + +with open(bashrc_file, 'w') as f: + f.writelines(output) +PYEOF + echo " Removed mlh wrapper function from ~/.bashrc" + else + # Fallback: simple sed (may not work perfectly for nested braces) + sed -i.bak "/${mlh_marker}/,/^}$/d" "$BASHRC" 2>/dev/null || true + echo " Removed mlh wrapper function from ~/.bashrc (fallback method)" + fi + fi + + # Remove bookmark wrapper function + local bookmark_marker="# MyLinuxHelper - bookmark wrapper function" + if grep -Fq "$bookmark_marker" "$BASHRC" 2>/dev/null; then + if command -v python3 >/dev/null 2>&1; then + python3 - "$BASHRC" "$bookmark_marker" <<'PYEOF' +import sys + +bashrc_file = sys.argv[1] +marker = sys.argv[2] + +with open(bashrc_file, 'r') as f: + lines = f.readlines() + +output = [] +in_block = False +brace_count = 0 +skip_next_empty = False + +for i, line in enumerate(lines): + if not in_block: + if marker in line: + in_block = True + brace_count = 0 + skip_next_empty = (i > 0 and lines[i-1].strip() == '') + continue + else: + output.append(line) + else: + brace_count += line.count('{') - line.count('}') + if line.strip() == '}' and brace_count <= 0: + in_block = False + if skip_next_empty and output and output[-1].strip() == '': + output.pop() + continue + +with open(bashrc_file, 'w') as f: + f.writelines(output) +PYEOF + echo " Removed bookmark wrapper function from ~/.bashrc" + else + sed -i.bak "/${bookmark_marker}/,/^}$/d" "$BASHRC" 2>/dev/null || true + echo " Removed bookmark wrapper function from ~/.bashrc (fallback method)" + fi + fi + + # Remove bookmark alias wrapper function if exists + if [ -n "$bookmark_alias" ]; then + local alias_marker="# MyLinuxHelper - ${bookmark_alias} alias wrapper" + if grep -Fq "$alias_marker" "$BASHRC" 2>/dev/null; then + if command -v python3 >/dev/null 2>&1; then + python3 - "$BASHRC" "$alias_marker" <<'PYEOF' +import sys + +bashrc_file = sys.argv[1] +marker = sys.argv[2] + +with open(bashrc_file, 'r') as f: + lines = f.readlines() + +output = [] +in_block = False +brace_count = 0 +skip_next_empty = False + +for i, line in enumerate(lines): + if not in_block: + if marker in line: + in_block = True + brace_count = 0 + skip_next_empty = (i > 0 and lines[i-1].strip() == '') + continue + else: + output.append(line) + else: + brace_count += line.count('{') - line.count('}') + if line.strip() == '}' and brace_count <= 0: + in_block = False + if skip_next_empty and output and output[-1].strip() == '': + output.pop() + continue + +with open(bashrc_file, 'w') as f: + f.writelines(output) +PYEOF + echo " Removed ${bookmark_alias} alias wrapper from ~/.bashrc" + else + sed -i.bak "/${alias_marker}/,/^}$/d" "$BASHRC" 2>/dev/null || true + echo " Removed ${bookmark_alias} alias wrapper from ~/.bashrc (fallback method)" + fi + fi + fi + + # Remove auto-update hook + local update_marker="# MyLinuxHelper auto-update check" + if grep -Fq "$update_marker" "$BASHRC" 2>/dev/null; then + if command -v python3 >/dev/null 2>&1; then + python3 - "$BASHRC" "$update_marker" <<'PYEOF' +import sys + +bashrc_file = sys.argv[1] +marker = sys.argv[2] + +with open(bashrc_file, 'r') as f: + lines = f.readlines() + +output = [] +in_block = False +skip_next_empty = False + +for i, line in enumerate(lines): + if not in_block: + if marker in line: + in_block = True + skip_next_empty = (i > 0 and lines[i-1].strip() == '') + continue + else: + output.append(line) + else: + if line.strip() == 'fi': + in_block = False + if skip_next_empty and output and output[-1].strip() == '': + output.pop() + continue + +with open(bashrc_file, 'w') as f: + f.writelines(output) +PYEOF + echo " Removed auto-update hook from ~/.bashrc" + else + sed -i.bak "/${update_marker}/,/^fi$/d" "$BASHRC" 2>/dev/null || true + echo " Removed auto-update hook from ~/.bashrc (fallback method)" + fi + fi + + # Clean up temp and backup files + rm -f "$temp_bashrc" 2>/dev/null || true + rm -f "${BASHRC}.bak" 2>/dev/null || true + rm -f "$bashrc_backup" 2>/dev/null || true + fi + + # Remove entries from ~/.profile + if [ -f "$PROFILE" ]; then + # shellcheck disable=SC2016 + local path_line='export PATH="$HOME/.local/bin:$PATH"' + if grep -Fq "$path_line" "$PROFILE" 2>/dev/null; then + # Check if this is the only PATH modification (safe to remove) + local path_count + path_count=$(grep -c 'export PATH=.*\.local/bin' "$PROFILE" 2>/dev/null || echo "0") + if [ "$path_count" -eq 1 ]; then + sed -i.bak "\|${path_line}|d" "$PROFILE" 2>/dev/null || true + echo " Removed PATH export from ~/.profile" + rm -f "${PROFILE}.bak" 2>/dev/null || true + else + echo " Note: Multiple PATH entries found in ~/.profile, not removing (manual cleanup may be needed)" + fi + fi + fi + + # Remove ~/.mylinuxhelper directory + if [ -d "$CONFIG_DIR" ]; then + rm -rf "$CONFIG_DIR" + echo " Removed: ~/.mylinuxhelper" + fi + + echo "" + echo "✅ Uninstall completed successfully!" + echo "" + echo "Note: You may need to restart your terminal or run 'source ~/.bashrc' to apply changes." + echo "" +} + main() { if [ $# -eq 0 ]; then print_version @@ -264,6 +598,10 @@ main() { check_and_update exit 0 ;; + uninstall) + uninstall_mlh + exit 0 + ;; *) echo "Error: Unknown command '$1'" >&2 echo "Run 'mlh --version --help' for usage information." >&2 diff --git a/plugins/mlh.sh b/plugins/mlh.sh index f4d16a8..3db41c8 100755 --- a/plugins/mlh.sh +++ b/plugins/mlh.sh @@ -81,11 +81,12 @@ MyLinuxHelper - App Settings & Updates 1. Show current version 2. Update to latest version 3. Configure periodic updates -4. Back to main menu +4. Uninstall MyLinuxHelper +5. Back to main menu EOF - read -rp "Select [1-4]: " SETTING_SELECTION + read -rp "Select [1-5]: " SETTING_SELECTION echo "" case "$SETTING_SELECTION" in @@ -100,7 +101,12 @@ EOF 3) exec "$SCRIPT_DIR/mlh-version.sh" update -p ;; - 4 | b | B) + 4) + "$SCRIPT_DIR/mlh-version.sh" uninstall + echo "" + read -rp "Press Enter to continue..." + ;; + 5 | b | B) return 0 ;; *)