mirror of
https://github.com/PirateBox-Dev/PirateBoxScripts_Webserver.git
synced 2023-12-14 07:22:58 +01:00
install_piratebox.sh: change also HOSTNAME in piratebox.conf on
This commit is contained in:
parent
34baa3375c
commit
ade7468a4c
|
@ -175,9 +175,23 @@ fi
|
|||
set_hostname() {
|
||||
name=$1 ; shift;
|
||||
|
||||
if test -z "$name" ; then
|
||||
echo "ERROR: Empty hostname not allowed ! '$name'"
|
||||
exit 128
|
||||
fi
|
||||
|
||||
# Set Bash EXIT on error
|
||||
set -e
|
||||
|
||||
sed -e "s|#####HOST#####|$name|g" \
|
||||
"$PIRATEBOX_FOLDER"/src/redirect.html.schema > \
|
||||
"$WWW_FOLDER"/index.html
|
||||
|
||||
# Also change configuration, because other parts of PirateBox are making use of it
|
||||
OLD_HOST=$HOST
|
||||
HOST=$name
|
||||
sed -i -e "s|^HOST=\"${OLD_HOST}\"|HOST=\"${HOST}\"|" "$PIRATEBOX_CONFIG"
|
||||
set +e
|
||||
}
|
||||
|
||||
if [ "$1" = "hostname" ] ; then
|
||||
|
|
Loading…
Reference in a new issue