Skip to content

Instantly share code, notes, and snippets.

@dimatall
dimatall / create_vhost.sh
Created February 23, 2024 16:18
Scan www directory and create new vhost based on folders in /var/www
#!/bin/bash
sortdomains=~/dont_remove.txt
vhostfile=/etc/apache2/sites-available
echo "Append domains to sort file.";
find /var/www -mindepth 1 -maxdepth 1 -type d -printf '%f\n' >> $sortdomains
echo "Loop";
for domain in `sort $sortdomains | uniq -u`;