diff --git a/pkg/fedora/diaspora-setup b/pkg/fedora/diaspora-setup index a1df72fbcf26291013fe500ffbfb1826f512f38b..0fa90dc9e4a9435601d14c4ef21681432edeb81f 100755 --- a/pkg/fedora/diaspora-setup +++ b/pkg/fedora/diaspora-setup @@ -43,13 +43,14 @@ fi chmod 777 /var/lib/diaspora/uploads chown -R diaspora /var/log/diaspora +hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml) + if [ -n "$arg_hostname" ]; then - sed -i "/pod_url:/s/$hostname/$arg_hostname/g" config/app_config.yml && + sed -i "/pod_url:/s|$hostname|$arg_hostname|g" config/app_config.yml && echo "config/app_config.yml updated." exit 0 fi -hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml) while : ; do echo "Current hostname is \"$hostname\"" echo -n "Enter new hostname [$hostname] :" @@ -57,7 +58,7 @@ while : ; do echo -n "Use hostname \"$new_hostname\" as pod_url (Yes/No) [Yes]? :" read yesno garbage test "${yesno:0:1}" = 'y' -o "${yesno:0:1}" = 'Y' -o -z "$yesno" && { - sed -i "/pod_url:/s/$hostname/$new_hostname/g" config/app_config.yml && + sed -i "/pod_url:/s|$hostname|$new_hostname|g" config/app_config.yml && echo "config/app_config.yml updated." break } diff --git a/pkg/ubuntu/diaspora-setup b/pkg/ubuntu/diaspora-setup index 4b9207fd314d9962102da2b7cf986ffb2d709703..3f2c0266c3371512b104428b5b2a5cb22e087fcc 100755 --- a/pkg/ubuntu/diaspora-setup +++ b/pkg/ubuntu/diaspora-setup @@ -46,13 +46,14 @@ fi chmod 777 /var/lib/diaspora/uploads chown -R diaspora /var/log/diaspora +hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml) + if [ -n "$arg_hostname" ]; then - sed -i "/pod_url:/s/$hostname/$arg_hostname/g" config/app_config.yml && + sed -i "/pod_url:/s|$hostname|$arg_hostname|g" config/app_config.yml && echo "config/app_config.yml updated." exit 0 fi -hostname=$( awk '/pod_url:/ { print $2; exit }' <config/app_config.yml) while : ; do echo "Current hostname is \"$hostname\"" echo -n "Enter new hostname [$hostname] :" @@ -60,7 +61,7 @@ while : ; do echo -n "Use hostname \"$new_hostname\" as pod_url (Yes/No) [Yes]? :" read yesno garbage test "${yesno:0:1}" = 'y' -o "${yesno:0:1}" = 'Y' -o -z "$yesno" && { - sed -i "/pod_url:/s/$hostname/$new_hostname/g" config/app_config.yml && + sed -i "/pod_url:/s|$hostname|$new_hostname|g" config/app_config.yml && echo "config/app_config.yml updated." break }