Skip to content

Commit

Permalink
v6.18
Browse files Browse the repository at this point in the history
+ DietPi-Software | Grafana: Wrap admin_password into tripled double quotes
+ DietPi-Software | Grafana: Move DB/plugin dir to userdata only, if it does not yet exist
+ DietPi-Software | PHPSysInfo: Backup existing config file before moving ours in place
  • Loading branch information
MichaIng authored Nov 20, 2018
1 parent beff8ec commit 1fb6414
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -4766,7 +4766,7 @@ _EOF_

fi

echo -e "deb $deb_address $G_DISTRO_NAME main" > /etc/apt/sources.list.d/grafana.list
echo "deb $deb_address $G_DISTRO_NAME main" > /etc/apt/sources.list.d/grafana.list
G_AGUP

fi
Expand Down Expand Up @@ -9735,12 +9735,21 @@ _EOF_

Banner_Configuration

# - Move DB/plugins to userdata location
mv /var/lib/grafana $G_FP_DIETPI_USERDATA/
# - Move DB/plugins to userdata location, if not already existent
if [[ -d $G_FP_DIETPI_USERDATA/grafana ]]; then

G_DIETPI-NOTIFY 2 "Existing database/plugin directory $G_FP_DIETPI_USERDATA/grafana found. Will not overwrite..."
[[ -e /var/lib/grafana ]] && rm -R /var/lib/grafana

else

mv /var/lib/grafana $G_FP_DIETPI_USERDATA/

fi
ln -sf $G_FP_DIETPI_USERDATA/grafana /var/lib/grafana

# - Set password
G_CONFIG_INJECT 'admin_password = ' "admin_password = $GLOBAL_PW" /etc/grafana/grafana.ini
# - Set password, wrap into trippled double quotes in case of ; or # being contained, according to docs: http://docs.grafana.org/installation/configuration/#password
G_CONFIG_INJECT 'admin_password[[:blank:]]*=' "admin_password = \"\"\"$GLOBAL_PW\"\"\"" /etc/grafana/grafana.ini

fi

Expand Down Expand Up @@ -9777,6 +9786,7 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then

Banner_Configuration
G_BACKUP_FP /DietPi/dietpi/conf/phpsysinfo.ini
cp /DietPi/dietpi/conf/phpsysinfo.ini /var/www/phpsysinfo/phpsysinfo.ini

fi
Expand Down

0 comments on commit 1fb6414

Please sign in to comment.