matomo corrections

This commit is contained in:
Valentin 2024-05-13 01:11:59 +02:00
parent e10ddb1a11
commit 957c1ba753
1 changed files with 8 additions and 10 deletions

View File

@ -3,19 +3,19 @@
echo -e "${PURPLE}${BOLD}Add a new website to track from the Matomo interface as an admin user${RESET}" echo -e "${PURPLE}${BOLD}Add a new website to track from the Matomo interface as an admin user${RESET}"
echo -e "${PURPLE}${BOLD}All website → Add a new Website → Website${RESET}" echo -e "${PURPLE}${BOLD}All website → Add a new Website → Website${RESET}"
echo -e "${PURPLE}${BOLD}Fill in the following informations :${RESET}" echo -e "${PURPLE}${BOLD}Fill in the following informations :${RESET}"
echo -e "${BLUE}${BOLD}Website name :${RESET}${BLUE}${DOMAIN_NAME}${RESET}" echo -e "${BLUE}${BOLD}Website name : ${RESET}${BLUE}${DOMAIN_NAME}${RESET}"
echo -e "${BLUE}${BOLD}Urls :${RESET}${BLUE}https://${DOMAIN_NAME}/${RESET}" echo -e "${BLUE}${BOLD}Urls : ${RESET}${BLUE}https://${DOMAIN_NAME}/${RESET}"
echo -e "${PURPLE}${BOLD}Enter the Matomo instance URL :${RESET}${PURPLE} ie : matomo.example.com${RESET}" echo -e "${PURPLE}${BOLD}Enter the Matomo instance URL :${RESET}${PURPLE} ie : matomo.example.com${RESET}"
read -s matomo_url read matomo_url
echo -e "${PURPLE}${BOLD}Find the website ID at the following URL${RESET}" echo -e "${PURPLE}${BOLD}Find the website ID at the following URL${RESET}"
echo -e "${PURPLE}https://${matomo_url}/index.php?module=SitesManager${RESET}" echo -e "${BLUE}https://${matomo_url}/index.php?module=SitesManager${RESET}"
echo -e "${PURPLE}${BOLD}Enter the Website ID :${RESET}" echo -e "${PURPLE}${BOLD}Enter the Website ID :${RESET}"
read -s matomo_website_id read matomo_website_id
get_username get_username
temp_matomo_script = /home/$username/matomo.html temp_matomo_script=/home/$username/matomo.html
index_file = /var/www/html/public/index.html index_file=/var/www/html/public/index.html
cp assets/matomo.html $temp_matomo_script cp assets/matomo.html $temp_matomo_script
@ -23,5 +23,3 @@ sed -i "s/var matomoSiteId = '';/var matomoSiteId = '$matomo_website_id';/g" $te
sed -i "s/var matomoInstanceUrl = '';/var matomoInstanceUrl = '$matomo_url';/g" $temp_matomo_script sed -i "s/var matomoInstanceUrl = '';/var matomoInstanceUrl = '$matomo_url';/g" $temp_matomo_script
sed -i '/<\/head>/i\'"$(cat $temp_matomo_script)"'' $index_file sed -i '/<\/head>/i\'"$(cat $temp_matomo_script)"'' $index_file
rm $temp_matomo_script