fix transmission
authorIan Kelling <ian@iankelling.org>
Thu, 4 Dec 2025 18:49:44 +0000 (13:49 -0500)
committerIan Kelling <ian@iankelling.org>
Thu, 4 Dec 2025 18:49:44 +0000 (13:49 -0500)
distro-end

index c66ce7e3c5bc58d20ec591e9f5975bf67df321a7..496c7c5d0a9030be46e3f44a27628bdc66c92b8a 100755 (executable)
@@ -64,7 +64,7 @@ end() {
 }
 pre="${0##*/}:"
 sudo() {
-  printf "$pre sudo %s\n"  "$*"
+  if [[ -t 1 ]]; then printf "$pre sudo %s\n"  "$*"; fi
   SUDOD="$PWD" command sudo "$@";
 }
 m() { printf "$pre %s\n"  "$*"; "$@"; }
@@ -123,6 +123,9 @@ sudo rm -fv /etc/apt/sources.list.d/wireguard-ubuntu-wireguard-bionic.list
 # remove old file
 sudo rm -fv /etc/apt/preferences.d/minetest
 
+
+
+
 #### initial packages
 pup
 if isdeb; then
@@ -1460,7 +1463,7 @@ done
 
 # /etc/transmission-daemon/README.json:
 #Currently transmission overwrites the settings.json configuration file
-# on exit. The daemon can be instructed to reload the config with a SIGHUP,
+# on start & exit. The daemon can be instructed to reload the config with a SIGHUP,
 # or
 #  # invoke-rc.d transmission-daemon reload
 
@@ -1484,6 +1487,7 @@ done
 tr-config-daemon() {
   d_host_suffix=$(awk '$2 == "'$d_host'" {print $1}' /p/c/host-info)
   u ~/.config/transmission-daemon-iank.rb <<EOF
+#!/usr/bin/ruby
 require 'json'
 p = '$tconf_dir/settings.json'
 s = {
@@ -1511,11 +1515,13 @@ EOF
 
   tmpf=$(mktemp)
   # shellcheck disable=SC2024 # false positive
-  if ! sudo ruby <~/.config/transmission-daemon-iank.rb >$tmpf; then
+  chmod +x ~/.config/transmission-daemon-iank.rb
+  if ! sudo ~/.config/transmission-daemon-iank.rb >$tmpf; then
     echo "iank ruby transmission error" >&2
     return 1
   fi
 
+
   # shellcheck disable=SC2154 # false positive
   if ! sudo diff -q $tmpf $tconf_dir/settings.json &>/dev/null; then
     restart_ser=false
@@ -1526,6 +1532,7 @@ EOF
     fi
     sudo dd of=$tconf_dir/settings.json <$tmpf 2>/dev/null
     if $restart_ser; then
+      sudo cat $tconf_dir/settings.json #debug
       m ser start $ser
     fi
   fi
@@ -1535,8 +1542,8 @@ tr-config-daemon
 case $HOSTNAME in
   $d_host)
     sgo transmission-daemon-nn
-;;
-  esac
+    ;;
+esac
 
 ####### end transmission
 
@@ -1576,7 +1583,7 @@ if [[ -e /p/transmission-rpc-pass ]]; then
       "profile-name" : "Default",
       "hostname" : "10.174.$d_host_suffix.2",
       "rpc-url-path" : "/transmission/rpc",
-      "username" : "",
+      "username" : "transmission",
       "password" : "$rpc_pass",
       "auto-connect" : true,
       "ssl" : false,