mirror of
https://github.com/lukasbestle/projectr.git
synced 2026-10-11 23:10:19 +02:00
General refactoring
This commit is contained in:
+5
-5
@@ -1,13 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
########################################################################
|
||||
# 2014-09-07 Lukas Bestle mail@lukasbestle.com
|
||||
# Copyright 2014 Lukas Bestle <project-projectr@lukasbestle.com>
|
||||
# License MIT
|
||||
########################################################################
|
||||
# Creates a link for the webserver pointing a domain to a site.
|
||||
#
|
||||
# Usage: site_link <site> <domain>
|
||||
#
|
||||
# <site> Name of the site (directory in ~/web/sites/)
|
||||
# <domain> FQDN of the domain (like "example.com")
|
||||
# <site> Name of the site (directory in ~/web/sites/)
|
||||
# <domain> FQDN of the domain (like "example.com")
|
||||
########################################################################
|
||||
|
||||
site="$1"
|
||||
@@ -40,7 +41,7 @@ fi
|
||||
# Create link
|
||||
echo -e "\033[1mCreating link from site \033[34m$site\033[0;1m to domain \033[34m$domain\033[0;1m...\033[0m"
|
||||
if ! ln -s "sites/$site/current" "$HOME/web/$domain"; then
|
||||
echo -e "\033[31mCould not create link at \033[34m$HOME/web/$domain\033[31m.\033[0m" >&2
|
||||
echo -e " => \033[31mCould not create link at \033[34m$HOME/web/$domain\033[31m.\033[0m" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo -e " => \033[32mSuccess.\033[0m"
|
||||
@@ -50,7 +51,6 @@ echo -e "\033[1mAdding domain to site's domains (\033[34m.domains\033[0;1m file)
|
||||
echo "$domain" >> "$HOME/web/sites/$site/.domains"
|
||||
if [[ $? == 0 ]]; then
|
||||
echo -e " => \033[32mSuccess.\033[0m"
|
||||
exit 0
|
||||
else
|
||||
echo -e " => \033[31mSomething went wrong.\033[0m" >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user