Last active
November 22, 2016 14:47
-
-
Save speters/57896313e35f4593f6efa85f793690ec to your computer and use it in GitHub Desktop.
Extracts XML files containing datapoint descriptions from Vitosoft300WithoutDocs.iso
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 | |
VITODIR="${HOME}/tmp/vitosoft/" | |
VITOSOFTISO_FILE="${VITODIR}/Vitosoft300WithoutDocs.iso" # ${HOME}/Downloads/Vitosoft300WithoutDocs.iso" | |
### | |
VITOSOFTISO_URL="https://update-vitosoft.viessmann.com/CurrentVersion/Vitosoft300WithoutDocs.iso" | |
VITOSOFTISO_FILELEN=2818441216 | |
VITOSOFTISO_LASTMODIFIED="Tue, 15 Dec 2015 15:54:01 GMT" | |
VITOSOFTISO_MD5="ba4b65ad6ec380f6b37fd7e9487c4fee" | |
FALLBACKSETUP_OFFSET="2574305280" | |
FALLBACKSETUP_FILELEN="116240229" | |
FALLBACKSETUP_MD5="14ceea407627d2e66a6a7a416aacdef5" | |
### | |
if [ ! -d "${VITODIR}" -o ! -w "${VITODIR}" ] ; then | |
echo "Directory ${VITODIR} not accessible for writing" | |
exit 1 | |
fi | |
if [ ! -x "$(which '7z')" ] ; then | |
echo "7z archiver not found" | |
exit 1 | |
fi | |
if [ ! -r "${VITODIR}/Vitosoft300SID1_Fallback_Setup.exe" ] ; then | |
if [ ! -r "${VITOSOFTISO_FILE}" ] ; then | |
echo "Could not read Vitosoft ISO file at '${VITOSOFTISO_FILE}'" | |
echo "It is available for download at ${VITOSOFTISO_URL}" | |
exit 1 | |
else | |
echo "Extracting Vitosoft300SID1_Fallback_Setup.exe to ${VITODIR}/ ..." | |
7z e -o"${VITODIR}/" "${VITOSOFTISO_FILE}" Data/Vitosoft300SID1_Fallback_Setup.exe | |
echo " done." | |
fi | |
fi | |
echo "Extracting XML files, etc. to ${VITODIR}/ ..." | |
for DIR in $(7z l "${VITODIR}/Vitosoft300SID1_Fallback_Setup.exe" | sed -n '/Textresource.*\.xml/s#.*OFFLINE/#OFFLINE/#;s#/Textresource.*xml##p' | sort | uniq) ; do | |
7z e -o"${VITODIR}" "${VITODIR}/Vitosoft300SID1_Fallback_Setup.exe" "${DIR}/*.xml" | |
done | |
echo " done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment