From b252c8c75550ee13c2721160ffa9863155e6495d Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Mon, 18 Mar 2019 11:59:06 +0100 Subject: [PATCH] fixed sed bug" --- bin/_addUserSite.sh | 2 +- bin/autoupdate.sh | 6 +++--- bin/email.sh | 4 ++-- bin/ftp.sh | 2 +- bin/gitbarrerepos.sh | 4 ++-- bin/lemp.sh | 4 ++-- bin/vhost.sh | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/_addUserSite.sh b/bin/_addUserSite.sh index 79e51b3..7472245 100755 --- a/bin/_addUserSite.sh +++ b/bin/_addUserSite.sh @@ -70,7 +70,7 @@ ln -s /home/"$user"/logs /var/www/"$_host_name"/logs # TODO create nginx vhost # cp "$_cwd"/assets/example.org.conf /etc/apache2/sites-available/"$_host_name".conf -# sed -ir "s/example\.org/$_host_name/g" /etc/apache2/sites-available/"$_host_name".conf +# sed -i -r "s/example\.org/$_host_name/g" /etc/apache2/sites-available/"$_host_name".conf #activate the vhost # a2ensite "$_host_name".conf #restart apache diff --git a/bin/autoupdate.sh b/bin/autoupdate.sh index 04040a9..3578058 100755 --- a/bin/autoupdate.sh +++ b/bin/autoupdate.sh @@ -23,8 +23,8 @@ sleep 3 echo -n "Enter an email: " read email -sed -ir "s/EMAIL=\"root\"/EMAIL=\"$email\"/g" /etc/apticron/apticron.conf -# sed -ir "s/# DIFF_ONLY=\"1\"/DIFF_ONLY=\"1\"/g" /etc/apticron/apticron.conf -sed -ir "s/# NOTIFY_NEW=\"0\"/NOTIFY_NEW=\"0\"/g" /etc/apticron/apticron.conf +sed -i -r "s/EMAIL=\"root\"/EMAIL=\"$email\"/g" /etc/apticron/apticron.conf +# sed -i -r "s/# DIFF_ONLY=\"1\"/DIFF_ONLY=\"1\"/g" /etc/apticron/apticron.conf +sed -i -r "s/# NOTIFY_NEW=\"0\"/NOTIFY_NEW=\"0\"/g" /etc/apticron/apticron.conf echo "\033[92;1mApticron installed and configured\033[0m" diff --git a/bin/email.sh b/bin/email.sh index deedda4..a10d402 100755 --- a/bin/email.sh +++ b/bin/email.sh @@ -66,8 +66,8 @@ if [ "$installdkim" = "y" ]; then chmod 440 /etc/exim4/dkim/"$domain"-private.pem cp "$_assets"/exim4_dkim.conf /etc/exim4/conf.d/main/00_local_macros - sed -ir "s/DOMAIN_TO_CHANGE/$domain/g" /etc/exim4/conf.d/main/00_local_macros - sed -ir "s/DATE_TO_CHANGE/$selector/g" /etc/exim4/conf.d/main/00_local_macros + sed -i -r "s/DOMAIN_TO_CHANGE/$domain/g" /etc/exim4/conf.d/main/00_local_macros + sed -i -r "s/DATE_TO_CHANGE/$selector/g" /etc/exim4/conf.d/main/00_local_macros update-exim4.conf systemctl restart exim4 diff --git a/bin/ftp.sh b/bin/ftp.sh index 91c2e4b..5009334 100755 --- a/bin/ftp.sh +++ b/bin/ftp.sh @@ -44,7 +44,7 @@ done echo "Configuring proftpd" cp "$_assets"/proftpd.conf /etc/proftpd/conf.d/"$_server_name".conf -sed -ir "s/example/$_server_name/g" /etc/proftpd/conf.d/"$_server_name".conf +sed -i -r "s/example/$_server_name/g" /etc/proftpd/conf.d/"$_server_name".conf ufw allow ftp diff --git a/bin/gitbarrerepos.sh b/bin/gitbarrerepos.sh index 47a8133..648afdf 100755 --- a/bin/gitbarrerepos.sh +++ b/bin/gitbarrerepos.sh @@ -102,8 +102,8 @@ if [ "$vh" = "yes" ]; then # cp "$_assets"/git-pre-receive /home/"$user"/git-repositories/"$_domain".git/hooks/pre-receive cp "$_assets"/git-post-receive /home/"$user"/git-repositories/"$_domain".git/hooks/post-receive - # sed -ir "s/PRODDIR=\"www\"/PRODDIR=/home/$user/www/$_domain/g" /home/"$user"/git-repositories/"$_domain".git/hooks/pre-receive - sed -ir "s#PRODDIR=\"www\"#PRODDIR=\"/home/$user/www/$_domain\"#g" /home/"$user"/git-repositories/"$_domain".git/hooks/post-receive + # sed -i -r "s/PRODDIR=\"www\"/PRODDIR=/home/$user/www/$_domain/g" /home/"$user"/git-repositories/"$_domain".git/hooks/pre-receive + sed -i -r "s#PRODDIR=\"www\"#PRODDIR=\"/home/$user/www/$_domain\"#g" /home/"$user"/git-repositories/"$_domain".git/hooks/post-receive chown -R "$user":"$user" /home/"$user"/git-repositories diff --git a/bin/lemp.sh b/bin/lemp.sh index cebd43c..889da66 100755 --- a/bin/lemp.sh +++ b/bin/lemp.sh @@ -109,8 +109,8 @@ echo -e '\033[35m echo -e "\033[35;1mInstalling phpMyAdmin \033[0m" apt-get --yes --force-yes install phpmyadmin ln -s /usr/share/phpmyadmin /var/www/html/ -# cp "$_assets"/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf -# ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf +cp "$_assets"/nginx-phpmyadmin.conf > /etc/nginx/sites-available/phpmyadmin.conf +ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/phpmyadmin.conf # echo -e "\033[35;1msecuring phpMyAdmin \033[0m" # sed -i "s/DirectoryIndex index.php/DirectoryIndex index.php\nAllowOverride all/" diff --git a/bin/vhost.sh b/bin/vhost.sh index 130da81..6740567 100755 --- a/bin/vhost.sh +++ b/bin/vhost.sh @@ -89,13 +89,13 @@ if [ "$vh" = "y" ]; then fi cp "$_assets/$_conffile" /etc/nginx/sites-available/"$_domain".conf - sed -ir "s/DOMAIN\.LTD/$_domain/g" /etc/nginx/sites-available/"$_domain".conf + sed -i -r "s/DOMAIN\.LTD/$_domain/g" /etc/nginx/sites-available/"$_domain".conf mkdir -p /var/www/"$_domain"/public_html mkdir /var/www/"$_domain"/log cp "$_assets/index.php" /var/www/"$_domain"/public_html/ - sed -ir "s/DOMAIN\.LTD/$_domain/g" /var/www/"$_domain"/public_html/index.php + sed -i -r "s/DOMAIN\.LTD/$_domain/g" /var/www/"$_domain"/public_html/index.php #set proper right to user will handle the app chown -R root:admin /var/www/"$_domain"/