]> git.ipfire.org Git - thirdparty/squid.git/blame - errors/alias-link.sh
Fix error pages not installed.
[thirdparty/squid.git] / errors / alias-link.sh
CommitLineData
b9d37c0b
AJ
1#!/bin/sh
2#
3# Generate Symlinks for a set of aliases.
4# Our base content is the bundled .po translation output
5#
6# This file creates the authoritative ISO aliases.
7#
b9d37c0b
AJ
8
9LN="${1}"
10RM="${2}"
11DIR="${3}"
12ALIASFILE="${4}"
13
14if ! test -f ${ALIASFILE} ; then
15 echo "FATAL: Alias file ${ALIASFILE} does not exist!"
16 exit 1
17fi
18
4d535806
AJ
19if ! test -d ${DIR} ; then
20 echo "WARNING: Destination directory does not exist. Nothing to do."
21 exit 0
22fi
23
b9d37c0b
AJ
24# Parse the alias file
25cat ${ALIASFILE} |
26while read base aliases; do
27 # file may be commented or have empty lines
28 if test "${base}" = "#" || test "${base}" = ""; then
29 continue;
30 fi
31 # split aliases based on whitespace and create a symlink for each
32 # Remove and replace any pre-existing content/link
33 for alia in ${aliases}; do
34 ${RM} -f -r ${DIR}/${alia} || exit 1
35 ${LN} -s ${DIR}/${base} ${DIR}/${alia} || exit 1
36 done
37done