Last active
August 29, 2015 13:57
-
-
Save maxwelleite/9768089 to your computer and use it in GitHub Desktop.
Forces to wipe/cleanup entire database of MediaTomb (UPnP Media Server - DLNA)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Author: Maxwel Leite | |
# Website: http://needforbits.tumblr.com/ | |
# | |
# Description: | |
# Forces to wipe/cleanup entire database of MediaTomb (UPnP Media Server - DLNA) | |
# | |
# Dependencies: sqlite3 | |
# | |
if [[ $EUID -ne 0 ]]; then | |
echo -e "You must be a root user!\nTry: sudo ./mediatomb-wipe-db.sh" 2>&1 | |
exit 1 | |
fi | |
command -v sqlite3 >/dev/null 2>&1 || { echo -e "I require sqlite3 but it's not installed. Aborting.\nTo install use: sudo apt-get install sqlite3" >&2; exit 1; } | |
service mediatomb stop | |
killall mediatomb | |
rm -rf /var/lib/mediatomb/mediatomb.db | |
sqlite3 /var/lib/mediatomb/mediatomb.db < /usr/share/mediatomb/sqlite3.sql | |
chown mediatomb:mediatomb /var/lib/mediatomb/mediatomb.db | |
chmod 644 /var/lib/mediatomb/mediatomb.db | |
service mediatomb start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment