From d3e0aca3d7b5ccce1c496734b0322e5625408e6d Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 10 Nov 2019 22:09:36 +0000 Subject: [PATCH] Initial commit --- installers/configport.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 installers/configport.sh diff --git a/installers/configport.sh b/installers/configport.sh new file mode 100755 index 00000000..c3f4165c --- /dev/null +++ b/installers/configport.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Updates lighttpd server.port and restarts the service in a predictable manner + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +server_port=$1 +lighttpd_conf=$2 +host=$3 + +echo "Changing lighttpd server.port to $server_port..." +sed -i "s/^\(server\.port *= *\)[0-9]*/\1$server_port/g" "$lighttpd_conf" + +echo "RaspAP will now be available at $host:$server_port" +echo "Restarting lighttpd in 5 seconds..." +sleep 5 +systemctl restart lighttpd.service