Files
restream-tools/scripts/nginx/build.sh
T
2022-01-27 19:42:55 +08:00

34 lines
570 B
Bash
Executable File

#!/bin/bash
set -e
tmpdir="$(mktemp -d)"
prefix="$1"
if [ -z "$prefix" ]; then
prefix="$(pwd)/nginx"
fi
mkdir -p "$prefix"
echo "Downloading nginx to $tmpdir"
wget -qO- http://nginx.org/download/nginx-1.21.6.tar.gz | tar -xzv -C "$tmpdir"
pushd "$tmpdir/nginx-1.21.6"
echo "Configuring nginx"
./configure \
--prefix="$prefix" \
--with-http_ssl_module --with-threads --with-http_realip_module
echo "Compiling nginx"
make -j "$(nproc)"
echo "Installing nginx"
make install
popd # "$tmpdir/nginx-1.21.6"
echo "Cleaning up"
rm -rf "$tmpdir"