Skip to content

Instantly share code, notes, and snippets.

@maxwelleite
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxwelleite/9768089 to your computer and use it in GitHub Desktop.
Save maxwelleite/9768089 to your computer and use it in GitHub Desktop.
Forces to wipe/cleanup entire database of MediaTomb (UPnP Media Server - DLNA)
#!/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