#!/bin/bash # Verify that a hostname has been provided host="$1" if [[ -z "$host" ]] then echo "No host provided. Usage: $0 " exit 1 fi # Update hostname hostname "$host" echo "$host" > /etc/hostname # Retrieve certificate certbot --nginx -d "$host" vim /etc/letsencrypt/renewal/$host.conf