1#!/bin/bash
2# Copyright (C) 2021 Intel Corporation.
3# SPDX-License-Identifier: BSD-3-Clause
4
5# Create top-level website redirect to a doc (conf.py redirect script can only
6# create redirects within the published folder output, e.g. latest/ or 2.6/)
7#
8#  publish-redirect docname.html destpath/docname.html
9
10if [[ $# -ne 2 ]]; then
11    echo "Error: $0 expects two parameters: docname.html destpath/docname.html" >&2
12    exit 1
13fi
14
15cat>"$1"<<EOF
16<html>
17  <head>
18    <title>ACRN Hypervisor documentation Redirect</title>
19    <meta http-equiv="refresh" content="0; URL=$2">
20    <script>
21      window.location.href = "$2"
22    </script>
23  </head>
24  <body>
25    <p>Please visit the <a href="/latest/">latest ACRN documentation</a></p>
26  </body>
27</html>
28EOF
29