Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 67 lines (57 sloc) 1.909 kb
#!/bin/sh
# Used by scripts/Makefile and scripts/rebar-pre-script to do a local
# install of yaws. The "make local_install" top-level command installs
# files under $HOME, whereas "rebar compile" keeps everything local to the
# build directory.
set -e
if [ -z "$2" ]; then
if [ -z "$HOME" ]; then
if [ `id -u` = 0 -a -d /root ]; then
HOME=/root
else
HOME=/tmp
fi
export HOME
fi
target_dir="${HOME}"
conf_dir="${HOME}"
else
target_dir="$2"
conf_dir="${target_dir}/etc/yaws"
[ -d "$target_dir" ] || mkdir "$target_dir"
[ -d "$target_dir/etc" ] || mkdir "$target_dir/etc"
[ -d "$target_dir/etc/yaws" ] || mkdir "$target_dir/etc/yaws"
fi
script=`basename $0`
tmpgen=`mktemp /tmp/${script}.XXXXXX`
logdir="${target_dir}/yaws_logs"
[ -d "$logdir" ] || mkdir "$logdir"
overwrite=true
if [ -f "${conf_dir}/yaws.conf" ]; then
overwrite=false
target="${conf_dir}/yaws.conf.template"
else
target="${conf_dir}/yaws.conf"
fi
topdir=`cd .. && pwd`
[ -d "${VARDIR}" ] || mkdir "${VARDIR}"
[ -d "${VARDIR}/yaws" ] || mkdir "${VARDIR}/yaws"
[ -d "${VARDIR}/yaws/ebin" ] || mkdir "${VARDIR}/yaws/ebin"
YAWSDIR="$topdir" LOGDIR="$logdir" VARDIR="$VARDIR" PORT=8000 \
DOCROOT="${topdir}/www" CERTDIR="${topdir}/ssl" SSLPORT=4443 \
./gen-yaws-conf > $tmpgen
if [ -f "$target" ] && cmp -s "$target" "$tmpgen"; then
rm -f "$tmpgen"
else
mv -f "$tmpgen" "$target"
[ $overwrite = false ] && echo "--- Will not overwrite ${conf_dir}/yaws.conf"
echo "--- Installing local config file at $target"
fi
[ "$topdir" = "$target_dir" ] && exit 0
if [ "$1" = true ] || [ ! -f "${target_dir}/bin/yaws" ]; then
[ -d "${target_dir}/bin" ] || mkdir "${target_dir}/bin"
rm -f "${target_dir}/bin/yaws"
cp -f ../bin/yaws "${target_dir}/bin/yaws"
echo "--- Installed $target_dir/bin/yaws"
fi
exit 0
Jump to Line
Something went wrong with that request. Please try again.