Skip to content
Snippets Groups Projects
Commit 0ae213a7 authored by Bob Mottram's avatar Bob Mottram
Browse files

Get domain name

parent ed1df8bd
No related branches found
No related tags found
No related merge requests found
......@@ -244,6 +244,8 @@ function reconfigure_gnusocial {
}
function gnusocial_set_background_image {
GNUSOCIAL_DOMAIN_NAME=$(get_completion_param "gnusocial domain")
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --title $"GNU Social" \
......
......@@ -228,6 +228,8 @@ function reconfigure_postactiv {
}
function postactiv_set_background_image {
POSTACTIV_DOMAIN_NAME=$(get_completion_param "postactiv domain")
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --title $"PostActiv" \
......@@ -240,9 +242,11 @@ function postactiv_set_background_image {
if [ ${#temp_background} -gt 0 ]; then
POSTACTIV_BACKGROUND_IMAGE_URL="$temp_background"
write_config_param "POSTACTIV_BACKGROUND_IMAGE_URL" "$POSTACTIV_BACKGROUND_IMAGE_URL"
pleroma_set_background_image_from_url "$POSTACTIV_DOMAIN_NAME" "$POSTACTIV_BACKGROUND_IMAGE_URL" "$POSTACTIV_TITLE"
dialog --title $"Set PostActiv background" \
--msgbox $"The background image has been set" 6 60
if [[ $(pleroma_set_background_image_from_url "$POSTACTIV_DOMAIN_NAME" "$POSTACTIV_BACKGROUND_IMAGE_URL" "$POSTACTIV_TITLE" | tail -n 1) == "0" ]]; then
dialog --title $"Set PostActiv background" \
--msgbox $"The background image has been set" 6 60
fi
fi
;;
esac
......
......@@ -39,6 +39,11 @@ function pleroma_set_background_image_from_url {
url="$2"
title="$3"
if [ ${#domain_name} -eq 0 ]; then
echo "1"
return
fi
ext=
if [ ${#url} -gt 0 ]; then
if [[ "$url" == *".jpeg" || "$url" == *".jpg" ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment