]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix echo target for superuser file in Debian postinst
authorMichael Marley <michael@michaelmarley.com>
Fri, 26 Apr 2024 17:50:17 +0000 (13:50 -0400)
committerFlole <Flole998@users.noreply.github.com>
Fri, 26 Apr 2024 17:57:22 +0000 (19:57 +0200)
aba5e60792177d6a2a867445559f4806973b3258 was causing the username
and password to get printed to the console instead of being put in
the correct file.  Also, use the modern $() syntax instead of ``
and quote all variable assignments.

debian/tvheadend.postinst

index 652f311b3633a40821bcb2b4c2b1c2d40ea39c3e..95def43f5953e57866cdadf843b03f1d0981123b 100644 (file)
@@ -57,17 +57,17 @@ configure)
     echo >>"$HTS_SUPERUSERCONF" "{"
 
     if db_get tvheadend/admin_username; then
-        JSONUSER=`escape_json_string $RET`
-        echo "\"username\": $JSONUSER,"
+        JSONUSER="$(escape_json_string "$RET")"
+        echo >>"$HTS_SUPERUSERCONF" "\"username\": $JSONUSER,"
         JSONUSER=""
     fi
 
     if db_get tvheadend/admin_password; then
-        JSONPASS=`escape_json_string $RET`
-        echo "\"password\": $JSONPASS"
+        JSONPASS="$(escape_json_string "$RET")"
+        echo >>"$HTS_SUPERUSERCONF" "\"password\": $JSONPASS"
         JSONPASS=""
     fi
-    
+
     echo >>"$HTS_SUPERUSERCONF" "}"
     ;;
 esac