From c94ece29254c1308ae144b9720a9cdc48dc83473 Mon Sep 17 00:00:00 2001 From: Walter Date: Thu, 5 Nov 2015 21:42:20 -0500 Subject: [PATCH] changed replace for sed command --- install.sh | 62 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/install.sh b/install.sh index 3f5b2edede..347be2d61d 100755 --- a/install.sh +++ b/install.sh @@ -190,20 +190,19 @@ case $distro in #Modify the Snipe-It files necessary for a production environment. echo "## Modify the Snipe-It files necessary for a production environment." echo " Setting up bootstrap file." - replace "'www.yourserver.com'" "'$hostname'" -- $webdir/$name/bootstrap/start.php + sed -i "s/www.yourserver.com/$hostname/g" $webdir/$name/bootstrap/start.php echo " Setting up database file." cp $webdir/$name/app/config/production/database.example.php $webdir/$name/app/config/production/database.php - replace "'snipeit_laravel'," "'snipeit'," -- $webdir/$name/app/config/production/database.php - replace "'travis'," "'snipeit'," -- $webdir/$name/app/config/production/database.php - replace " 'password' => ''," " 'password' => '$mysqluserpw'," -- $webdir/$name/app/config/production/database.php - replace "'production.yourserver.com'," "'$fqdn'," -- $webdir/$name/app/config/production/database.php + sed -i "s/snipeit_laravel/snipeit/g" $webdir/$name/app/config/production/database.php + sed -i "s/travis/snipeit/g" $webdir/$name/app/config/production/database.php + sed -i "s/password' => ''/password' => '$mysqluserpw'/g" $webdir/$name/app/config/production/database.php echo " Setting up app file." cp $webdir/$name/app/config/production/app.example.php $webdir/$name/app/config/production/app.php - replace "'production.yourserver.com'," "'$fqdn'," -- $webdir/$name/app/config/production/app.php - replace "'Change_this_key_or_snipe_will_get_ya'," "'$random32'," -- $webdir/$name/app/config/production/app.php - replace "'false'," "true," -- $webdir/$name/app/config/production/app.php + sed -i "s/production.yourserver.com/$fqdn/g" $webdir/$name/app/config/production/app.php + sed -i "s/Change_this_key_or_snipe_will_get_ya/$random32/g" $webdir/$name/app/config/production/app.php + sed -i "s/false/true/g" $webdir/$name/app/config/production/app.php echo " Setting up mail file." cp $webdir/$name/app/config/production/mail.example.php $webdir/$name/app/config/production/mail.php @@ -329,17 +328,23 @@ case $distro in # if $tzone == #Modify the Snipe-It files necessary for a production environment. - echo "## Modify the Snipe-It files necessary for a production environment."; + echo "## Modify the Snipe-It files necessary for a production environment." + echo " Setting up bootstrap file." + sed -i "s/www.yourserver.com/$hostname/g" $webdir/$name/bootstrap/start.php - replace "'www.yourserver.com'" "'$hostname'" -- $webdir/$name/bootstrap/start.php + echo " Setting up database file." cp $webdir/$name/app/config/production/database.example.php $webdir/$name/app/config/production/database.php - replace "'snipeit_laravel'," "'snipeit'," -- $webdir/$name/app/config/production/database.php - replace "'travis'," "'snipeit'," -- $webdir/$name/app/config/production/database.php - replace " 'password' => ''," " 'password' => '$mysqluserpw'," -- $webdir/$name/app/config/production/database.php - replace "'production.yourserver.com'," "'$fqdn'," -- $webdir/$name/app/config/production/database.php + sed -i "s/snipeit_laravel/snipeit/g" $webdir/$name/app/config/production/database.php + sed -i "s/travis/snipeit/g" $webdir/$name/app/config/production/database.php + sed -i "s/password' => ''/password' => '$mysqluserpw'/g" $webdir/$name/app/config/production/database.php + + echo " Setting up app file." cp $webdir/$name/app/config/production/app.example.php $webdir/$name/app/config/production/app.php - replace "'production.yourserver.com'," "'$fqdn'," -- $webdir/$name/app/config/production/app.php - replace "'Change_this_key_or_snipe_will_get_ya'," "'$random32'," -- $webdir/$name/app/config/production/app.php + sed -i "s/production.yourserver.com/$fqdn/g" $webdir/$name/app/config/production/app.php + sed -i "s/Change_this_key_or_snipe_will_get_ya/$random32/g" $webdir/$name/app/config/production/app.php + sed -i "s/false/true/g" $webdir/$name/app/config/production/app.php + + echo " Setting up mail file." cp $webdir/$name/app/config/production/mail.example.php $webdir/$name/app/config/production/mail.php # Change permissions on directories @@ -450,19 +455,24 @@ case $distro in # if $tzone == #Modify the Snipe-It files necessary for a production environment. - echo "## Modify the Snipe-It files necessary for a production environment."; + echo "## Modify the Snipe-It files necessary for a production environment." + echo " Setting up bootstrap file." + sed -i "s/www.yourserver.com/$hostname/g" $webdir/$name/bootstrap/start.php - replace "'www.yourserver.com'" "'$hostname'" -- $webdir/$name/bootstrap/start.php > /dev/null + echo " Setting up database file." cp $webdir/$name/app/config/production/database.example.php $webdir/$name/app/config/production/database.php - replace "'snipeit_laravel'," "'snipeit'," -- $webdir/$name/app/config/production/database.php > /dev/null - replace "'travis'," "'snipeit'," -- $webdir/$name/app/config/production/database.php > /dev/null - replace " 'password' => ''," " 'password' => '$mysqluserpw'," -- $webdir/$name/app/config/production/database.php > /dev/null - replace "'production.yourserver.com'," "'$fqdn'," -- $webdir/$name/app/config/production/database.php > /dev/null - cp $webdir/$name/app/config/production/app.example.php $webdir/$name/app/config/production/app.php - replace "'production.yourserver.com'," "'$fqdn'," -- $webdir/$name/app/config/production/app.php > /dev/null - replace "'Change_this_key_or_snipe_will_get_ya'," "'$random32'," -- $webdir/$name/app/config/production/app.php > /dev/null - cp $webdir/$name/app/config/production/mail.example.php $webdir/$name/app/config/production/mail.php + sed -i "s/snipeit_laravel/snipeit/g" $webdir/$name/app/config/production/database.php + sed -i "s/travis/snipeit/g" $webdir/$name/app/config/production/database.php + sed -i "s/password' => ''/password' => '$mysqluserpw'/g" $webdir/$name/app/config/production/database.php + echo " Setting up app file." + cp $webdir/$name/app/config/production/app.example.php $webdir/$name/app/config/production/app.php + sed -i "s/production.yourserver.com/$fqdn/g" $webdir/$name/app/config/production/app.php + sed -i "s/Change_this_key_or_snipe_will_get_ya/$random32/g" $webdir/$name/app/config/production/app.php + sed -i "s/false/true/g" $webdir/$name/app/config/production/app.php + + echo " Setting up mail file." + cp $webdir/$name/app/config/production/mail.example.php $webdir/$name/app/config/production/mail.php # Change permissions on directories sudo chmod -R 755 $webdir/$name/app/storage