neb/tools/repo/setup-server-folder.sh
2023-10-22 17:45:21 +02:00

9 lines
No EOL
485 B
Bash
Executable file

#!/bin/sh
if ! [ -d "servers/${1:-$HOSTNAME}" ]; then
echo "setting up servers/${1:-$HOSTNAME}..."
cp -r servers/skel/. servers/${1:-$HOSTNAME}
sed -i "s/localhost/${1:-$HOSTNAME}.ixvd.net/g" servers/${1:-$HOSTNAME}/docker-compose.d/custom/nginx/conf.d/default.conf
sed -i "s/localhost/${1:-$HOSTNAME}.ixvd.net/g" servers/${1:-$HOSTNAME}/docker-compose.d/docker-compose.yml
echo "server configuration for \`${1:-$HOSTNAME}\`." >servers/${1:-$HOSTNAME}/README.md
fi