mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-19 14:36:22 -05:00
Creating script to reset tags.
This commit is contained in:
parent
18d3cfd686
commit
48acfc62bc
1 changed files with 22 additions and 0 deletions
22
scripts/reset_tags.sh
Executable file
22
scripts/reset_tags.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source /opt/wrolpi/wrolpi/scripts/lib.sh
|
||||
|
||||
# Re-execute this script if it wasn't called with sudo.
|
||||
if [ $EUID != 0 ]; then
|
||||
sudo "$0" "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
yes_or_no "Are you sure you want to delete all tags? This cannot be undone." || exit 0
|
||||
|
||||
set -x
|
||||
|
||||
systemctl stop wrolpi-api
|
||||
|
||||
# Delete all tag relationships and tags from the database.
|
||||
sudo -iu postgres psql -d wrolpi -c "DELETE FROM tag_zim;"
|
||||
sudo -iu postgres psql -d wrolpi -c "DELETE FROM tag_file;"
|
||||
sudo -iu postgres psql -d wrolpi -c "DELETE FROM tag;"
|
||||
|
||||
systemctl start wrolpi-api
|
||||
Loading…
Add table
Add a link
Reference in a new issue