}
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" "$*"; "$@"; }
# remove old file
sudo rm -fv /etc/apt/preferences.d/minetest
+
+
+
#### initial packages
pup
if isdeb; then
# /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
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 = {
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
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
case $HOSTNAME in
$d_host)
sgo transmission-daemon-nn
-;;
- esac
+ ;;
+esac
####### end transmission
"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,