#!/bin/sh
### Copyright 1999-2018. Parallels IP Holdings GmbH. All Rights Reserved.

if [ -n "$PLESK_INSTALLER_DEBUG" -o -n "$PLESK_INSTALLER_VERBOSE" ]; then
	set -x;
fi

prog="`basename $0`"
tmp_d="/usr/local/psa/var"
mu="`echo $prog | awk -F '-' '{print $1}'`"
mu_flag="$tmp_d/${mu}-vhost-links.flag"

[ -f "$mu_flag" ] && exit 0

sed -i \
	-e 's|http://www.plesk.com|https://www.plesk.com|g' \
 	-e 's|http://devblog.plesk.com/|https://www.plesk.com/blog/|g' \
 	-e 's|http://talk.plesk.com/|https://talk.plesk.com/|g' \
 	-e 's|http://kb.plesk.com/|https://support.plesk.com/|g' \
 	-e 's|https://twitter.com/PleskOfficial|https://twitter.com/Plesk|g' \
 	-e 's|https://twitter.com/PleskbyOdin|https://twitter.com/Plesk|g' \
 	-e 's|https://www.facebook.com/PleskbyOdin|https://www.facebook.com/Plesk|g' \
 	-e 's|http://www.parallels.com/products/panel/intro|https://www.plesk.com|g' \
	/var/www/vhosts/default/htdocs/index.html /var/www/vhosts/.skel/0/httpdocs/index.html \
>/dev/null 2>&1

touch $mu_flag
exit 0
