Skip to content

Instantly share code, notes, and snippets.

@mynamebvh
Last active April 26, 2025 03:11
Show Gist options
  • Select an option

  • Save mynamebvh/2b216026d37669fd9629b2591370375f to your computer and use it in GitHub Desktop.

Select an option

Save mynamebvh/2b216026d37669fd9629b2591370375f to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Author: HoangBui
RED="\e[1;31m"
ENDCOLOR="\e[0m"
echo -e "${RED}"
echo -e "======================================="
echo -e "| !!! WARNING !!! |"
echo -e "======================================="
echo -e "| Tat ca du lieu se bay mau. |"
echo -e "======================================="
echo -e "${ENDCOLOR}"
echo "Chon database reset"
echo "1. MySQL"
echo "2. PostgreSQL"
echo "3. MongoDB"
read CHOOSE
echo -e "Dang xu ly...................."
sleep 1
if [ $CHOOSE == 1 ]
then
dconf reset -f /com/premiumsoft/navicat-mysql/
sed -i -E 's/,?"([A-Z0-9]+)":\{([^\}]+)},?//g' ~/.config/navicat/MySQL/preferences.json
echo -e "Reset thanh cong"
elif [ $CHOOSE == 2 ]
then
dconf reset -f /com/premiumsoft/navicat-pgsql/
sed -i -E 's/,?"([A-Z0-9]+)":\{([^\}]+)},?//g' ~/.config/navicat/PostgreSQL/preferences.json
echo -e "Reset thanh cong"
elif [ $CHOOSE == 3 ]
then
dconf reset -f /com/premiumsoft/navicat-mongodb/
sed -i -E 's/,?"([A-Z0-9]+)":\{([^\}]+)},?//g' ~/.config/navicat/MongoDB/preferences.json
echo -e "Reset thanh cong"
else
echo "Chua ho tro database nay"
fi
@mynamebvh
Copy link
Author

===Support===
OS: Ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment