From d49dd672463aff72bd754d657abbd11cf8a0d8e0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 2 Jun 2018 17:58:57 +0200 Subject: revamp uucp-mediaclient --- hel/recv-media.nix | 72 ------------------------------------------------------ 1 file changed, 72 deletions(-) delete mode 100644 hel/recv-media.nix (limited to 'hel/recv-media.nix') diff --git a/hel/recv-media.nix b/hel/recv-media.nix deleted file mode 100644 index 91801593..00000000 --- a/hel/recv-media.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ stdenv -, coreutils -, writeScriptBin -, eject -, notifyUser ? "gkleen" -, showTitle ? true -, ffmpeg ? null -, gnused ? null -, wrapperDir ? "/run/wrappers/bin" -}: - -assert showTitle -> ffmpeg != null && gnused != null && notifyUser != null; - -writeScriptBin "recv-media" '' - #!${stdenv.shell} - - pid=$? - notify=${if notifyUser == null then "false" else "true"} - notifyUser=${if notifyUser == null then "" else notifyUser} - - PATH=${wrapperDir}:${eject}/bin:${coreutils}/bin${if showTitle then '':${ffmpeg}/bin:${gnused}/bin'' else ""} - - exec 1> >(logger --id=$pid -t recv-media -p user.notice) - exec 2> >(logger --id=$pid -t recv-media -p user.error) - - [[ -z "$1" || -z "$2" ]] && exit 2 - - dir=/var/media - group=$(stat -c '%G' $dir) - tmpFile="''${dir}/.tmp/''${1:t}" - target="''${dir}/''${1:t}" - - if [[ -n "''${3}" ]]; then - target="''${dir}"/$(base64 -d <<<''${3}) - fi - - logger --id=$pid -t recv-media -p user.debug </dev/null | sed -r '/^\[CHAPTER\]$/q; /^title=/!d; s/^title=//')'' else ''""''} - [[ -z "''${summary}" ]] && summary=$(basename "$1") - printf "%s\n%s\n" "''${summary}" "" | notify-''${notifyUser} -a recv-media || true - ) || true - fi -'' -- cgit v1.2.3