DietPi V6 ROCKS!!!!!

Hello y’all,

I just went from DietPi 1.59 to V6 in NO time at all!!

Everything works great (and faster!)

Just one question. I add some variables (for example: DietPi-version) to my website.

script:

#!/bin/bash

VAR2="$(df -h /mnt/dietpi_userdata | tail -1 | awk ‘{print $4}’)"
VAR3="$(cat /etc/debian_version)"
VAR4="$(cat /boot/dietpi/.version)"
VAR5="$(wc -l < ~/motion.txt)"
sed -i “1s/.*/<p style=“color:#FFFFFF”>Free Space = $VAR2 / OS = Debian $VAR3 / DietPiVersion = $VAR4 / Reboots = $VAR5</p>/” /var/www/index.html

But the command: “(cat /boot/dietpi/.version)” now gives me 2 lines with numbers instead of 1 line. (and therefor the above script doesn’t work).

What’s clever? trying to remove the “newlines” in .version. (or will that interfere with dietpi-scripts that look in this file?)

Again: DietPi V6 ROCKS!!!

(a Odroidc2 user)

got it:

VAR4="$(sed -n ‘:a; $ ! {N;ba}; s/\n/./g;p’ /boot/dietpi/.version)"

(output is: “6.1”)

Thanks for your kind feedback! :slight_smile:
Okay you already found it. Yeah 1. line = main version, 2. line = subversion. Separated to make handling in scripts easier.