#!/bin/bash
# Hebt den Tabellen- und Dokumentenschutz einer ods Datei auf
# Eingabe mit „sh schutz_aufheben.sh Dokumenten_Name” Beispiel: sh schutz_aufheben.sh Info_geschuetzt.ods
# gefunden by http://blog.falco2.de

unzip $1 content.xml >/dev/null 2>&1 && find content.xml -type f -exec sed -i 's/table:protected="true"/table:protected="false"/g' {} \; && find content.xml -type f -exec sed -i 's/table:structure-protected="true"/table:structure-protected="false"/g' {} \; && zip -v $1 content.xml >/dev/null 2>&1 && rm content.xml
echo "Der Schutz von $1 wurde aufgehoben"
exit 0
