Skip to content

Instantly share code, notes, and snippets.

@bolitao
Forked from nakamuraos/reset-trial-navicat.sh
Last active May 18, 2023 08:10
Show Gist options
  • Save bolitao/c016846c20c807fe22074dafa3cdbd16 to your computer and use it in GitHub Desktop.
Save bolitao/c016846c20c807fe22074dafa3cdbd16 to your computer and use it in GitHub Desktop.

Revisions

  1. @nakamuraos nakamuraos revised this gist Mar 30, 2022. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions reset-trial-navicat.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    # Author: NakamuraOS
    # https://github.com/nakamuraos
    # Latest update: 21/03/2022
    # Latest update: 30/03/2022
    # Tested on Navicat 15.x, 16.x on Linux

    RED="\e[1;31m"
    @@ -14,7 +14,6 @@ echo -e "| !!! WARNING !!! |"
    echo -e "======================================="
    echo -e "| All data can be destroy. |"
    echo -e "| Always backup before continue. |"
    echo -e "| Note: Virtual Grouping will be lost |"
    echo -e "======================================="
    echo -e "${ENDCOLOR}"

    @@ -24,8 +23,14 @@ echo
    if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Cleaning..."
    rm -rf ~/.config/dconf/user
    rm -rf ~/.config/navicat/Premium
    # Backup
    cp ~/.config/dconf/user ~/.config/dconf/user.bk
    cp ~/.config/navicat/Premium/preferences.json ~/.config/navicat/Premium/preferences.json.bk
    # Clear data in dconf
    dconf reset -f /com/premiumsoft/navicat-premium/
    # Remove data fields in config file
    sed -i -E 's/,?"([A-Z0-9]+)":\{([^\}]+)},?//g' ~/.config/navicat/Premium/preferences.json
    # Done
    echo "Done."
    else
    echo "Aborted."
  2. @nakamuraos nakamuraos revised this gist Mar 21, 2022. No changes.
  3. @nakamuraos nakamuraos revised this gist Mar 21, 2022. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions reset-trial-navicat.sh
    Original file line number Diff line number Diff line change
    @@ -9,13 +9,13 @@ RED="\e[1;31m"
    ENDCOLOR="\e[0m"

    echo -e "${RED}"
    echo -e "===================================="
    echo -e "| !!! WARNING !!! |"
    echo -e "===================================="
    echo -e "| All data can be destroy. |"
    echo -e "| Always backup before continue. |"
    echo -e "| Note: Virtual Grouping will lost |"
    echo -e "===================================="
    echo -e "======================================="
    echo -e "| !!! WARNING !!! |"
    echo -e "======================================="
    echo -e "| All data can be destroy. |"
    echo -e "| Always backup before continue. |"
    echo -e "| Note: Virtual Grouping will be lost |"
    echo -e "======================================="
    echo -e "${ENDCOLOR}"

    echo "Reset trial & clear all data settings."
  4. @nakamuraos nakamuraos revised this gist Mar 21, 2022. 1 changed file with 9 additions and 8 deletions.
    17 changes: 9 additions & 8 deletions reset-trial-navicat.sh
    Original file line number Diff line number Diff line change
    @@ -2,19 +2,20 @@

    # Author: NakamuraOS
    # https://github.com/nakamuraos
    # Date: 04/12/2021
    # Tested on Navicat 15.x on Linux
    # Latest update: 21/03/2022
    # Tested on Navicat 15.x, 16.x on Linux

    RED="\e[1;31m"
    ENDCOLOR="\e[0m"

    echo -e "${RED}"
    echo -e "=================================="
    echo -e "| !!! WARNING !!! |"
    echo -e "=================================="
    echo -e "| All data can be destroy. |"
    echo -e "| Always backup before continue. |"
    echo -e "=================================="
    echo -e "===================================="
    echo -e "| !!! WARNING !!! |"
    echo -e "===================================="
    echo -e "| All data can be destroy. |"
    echo -e "| Always backup before continue. |"
    echo -e "| Note: Virtual Grouping will lost |"
    echo -e "===================================="
    echo -e "${ENDCOLOR}"

    echo "Reset trial & clear all data settings."
  5. @nakamuraos nakamuraos revised this gist Jan 4, 2022. 1 changed file with 1 addition and 5 deletions.
    6 changes: 1 addition & 5 deletions reset-trial-navicat.sh
    Original file line number Diff line number Diff line change
    @@ -23,11 +23,7 @@ echo
    if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Cleaning..."
    # Comment this lines because this is old method
    # (All data will be lost)
    # rm -rf ~/.config/dconf/user
    # rm -rf ~/.config/navicat
    # New method: Only data settings will be lost
    rm -rf ~/.config/dconf/user
    rm -rf ~/.config/navicat/Premium
    echo "Done."
    else
  6. @nakamuraos nakamuraos revised this gist Dec 4, 2021. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions reset-trial-navicat.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    # Author: NakamuraOS
    # https://github.com/nakamuraos
    # Date: 22/11/2021
    # Date: 04/12/2021
    # Tested on Navicat 15.x on Linux

    RED="\e[1;31m"
    @@ -12,18 +12,23 @@ echo -e "${RED}"
    echo -e "=================================="
    echo -e "| !!! WARNING !!! |"
    echo -e "=================================="
    echo -e "| All data will destroy. |"
    echo -e "| All data can be destroy. |"
    echo -e "| Always backup before continue. |"
    echo -e "=================================="
    echo -e "${ENDCOLOR}"

    echo "Reset trial & clear all data."
    echo "Reset trial & clear all data settings."
    read -p "Are you sure? (Y/n) " -n 1 -r
    echo
    if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Cleaning..."
    rm -rf ~/.config/dconf/user ~/.config/navicat
    # Comment this lines because this is old method
    # (All data will be lost)
    # rm -rf ~/.config/dconf/user
    # rm -rf ~/.config/navicat
    # New method: Only data settings will be lost
    rm -rf ~/.config/navicat/Premium
    echo "Done."
    else
    echo "Aborted."
  7. @nakamuraos nakamuraos created this gist Nov 22, 2021.
    30 changes: 30 additions & 0 deletions reset-trial-navicat.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    #!/bin/bash

    # Author: NakamuraOS
    # https://github.com/nakamuraos
    # Date: 22/11/2021
    # Tested on Navicat 15.x on Linux

    RED="\e[1;31m"
    ENDCOLOR="\e[0m"

    echo -e "${RED}"
    echo -e "=================================="
    echo -e "| !!! WARNING !!! |"
    echo -e "=================================="
    echo -e "| All data will destroy. |"
    echo -e "| Always backup before continue. |"
    echo -e "=================================="
    echo -e "${ENDCOLOR}"

    echo "Reset trial & clear all data."
    read -p "Are you sure? (Y/n) " -n 1 -r
    echo
    if [[ $REPLY =~ ^[Yy]$ ]]
    then
    echo "Cleaning..."
    rm -rf ~/.config/dconf/user ~/.config/navicat
    echo "Done."
    else
    echo "Aborted."
    fi