10a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#!/bin/sh
20a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim
30a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim# Copyright (c) 2014 Xiph.Org Foundation and Mozilla Foundation
40a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#
50a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  Redistribution and use in source and binary forms, with or without
60a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  modification, are permitted provided that the following conditions
70a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  are met:
80a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#
90a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  - Redistributions of source code must retain the above copyright
100a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  notice, this list of conditions and the following disclaimer.
110a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#
120a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  - Redistributions in binary form must reproduce the above copyright
130a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  notice, this list of conditions and the following disclaimer in the
140a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  documentation and/or other materials provided with the distribution.
150a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#
160a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
170a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
180a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
190a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
200a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
210a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
220a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
230a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
240a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
250a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
260a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
270a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim
280a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#Stop on errors
290a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limset -e
300a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim#Set the CWD to the location of this script
310a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim[ -n "${0%/*}" ] && cd "${0%/*}"
320a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim
330a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia LimHTML=opus_in_isobmff.html
340a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim
350a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limecho downloading updates...
360a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia LimCSS=${HTML%%.html}.css
370a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limwget -q http://vfrmaniac.fushizen.eu/contents/${HTML} -O ${HTML}
380a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limwget -q http://vfrmaniac.fushizen.eu/style.css -O ${CSS}
390a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim
400a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limecho updating links...
410a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limcat ${HTML} | sed -e "s/\\.\\.\\/style.css/${CSS}/" > ${HTML}+ && mv ${HTML}+ ${HTML}
420a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim
430a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limecho stripping...
440a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limcat ${HTML} | sed -e 's/<!--.*-->//g' > ${HTML}+ && mv ${HTML}+ ${HTML}
450a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limcat ${HTML} | sed -e 's/ *$//g' > ${HTML}+ && mv ${HTML}+ ${HTML}
460a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limcat ${CSS}  | sed -e 's/ *$//g' > ${CSS}+ && mv ${CSS}+ ${CSS}
470a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim
480a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Lim
490a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia LimVERSION=$(fgrep Version ${HTML} | sed 's/.*Version \([0-9]\.[0-9]\.[0-9]\).*/\1/')
500a1406acbe87c63044e9da7e0ab41bcbfa704f3dFelicia Limecho Now at version ${VERSION}
51