14 lines
368 B
Bash
14 lines
368 B
Bash
#!/bin/sh
|
|
set -o xtrace # Write all commands first to stderr
|
|
set -o errexit # Exit the script with error if any of the commands fail
|
|
|
|
if [ -w /etc/hosts ]; then
|
|
SUDO=""
|
|
else
|
|
SUDO="sudo"
|
|
fi
|
|
|
|
# Add 'server' and 'hostname_not_in_cert' as a hostnames
|
|
echo "127.0.0.1 server" | $SUDO tee -a /etc/hosts
|
|
echo "127.0.0.1 hostname_not_in_cert" | $SUDO tee -a /etc/hosts
|