xref: /freebsd/contrib/libxo/xohtml/xohtml.sh.in (revision 43d55325406e96e37be661de52289c2592c82ec9)
1#!/bin/sh
2#
3# Copyright (c) 2014, Juniper Networks, Inc.
4# All rights reserved.
5# This SOFTWARE is licensed under the LICENSE provided in the
6# ../Copyright file. By downloading, installing, copying, or otherwise
7# using the SOFTWARE, you agree to be bound by the terms of that
8# LICENSE.
9# Phil Shafer, July 2014
10#
11
12BASE=@XO_SHAREDIR@
13CMD=cat
14DONE=
15
16while [ -z "$DONE" -a ! -z "$1" ]; do
17    case "$1" in
18        -b|--base)
19            shift;
20            BASE="$1";
21	    shift;
22            ;;
23        -c|--command)
24            shift;
25            CMD="$1";
26	    shift;
27            ;;
28        -f|--file)
29            shift;
30            FILE="$1";
31	    shift;
32	    exec > "$FILE";
33            ;;
34	*)
35	    DONE=1;
36	    ;;
37    esac
38done
39
40echo "<html>\n<head>\n"
41echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>'
42echo '<link rel="stylesheet" href="'$BASE'/xohtml.css">'
43echo '<link rel="stylesheet" href="'$BASE'/external/jquery.qtip.css"/>'
44echo '<script type="text/javascript" src="'$BASE'/external/jquery.js"></script>'
45echo '<script type="text/javascript" src="'$BASE'/external/jquery.qtip.js"></script>'
46echo '<script type="text/javascript" src="'$BASE'/xohtml.js"></script>'
47echo '<script>'
48echo '</script>'
49echo "</head>\n<body>\n"
50
51$CMD
52
53echo "</body>\n</html>\n"
54
55exit 0
56