Help running custom script please - error code 255

Sonarr version (exact version): 3.0.3.701
OS: Unraid (Linuxserver docker
Debug logs:
(Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here. Post in .txt not .doc, .rtf or some other formatted document)
Description of issue:
I’m trying to run a custom script but I’m failing badly. I read somewhere it needs an exit code of 0 for sonarr_eventtype but no matter what I do it keeps saying error 255.

Help please!

https://privatebin.net/?a1b8ffcf86725554#24SPRPeU5YWdNNWff37c8dCkc27mF5bXBHXaWni12B3t

#!/bin/bash

sonarr_label="tv"
base_dir=$(basename $sonarr_episodefile_sourcefolder)
test_ping=$sonarr_eventtype

if [ $sonarr_eventtype == "Test" ];then
  exit 0
fi

if [ "${base_dir}" == "${sonarr_label}" ];then
  echo "Single file torrent"
  exit
fi

find $sonarr_episodefile_sourcefolder -name \*.r[0-9][0-9] | egrep '.*' &>/dev/null

case $? in
  0)
  echo "Rar files present, deleting video files"
  echo `rm -rv "${sonarr_episodefile_sourcepath}"`
  ;;
  *)
  echo "No rar files, nothing to clean"
  ;;
esac

The link is not working for me (assuming it’s logs), please repost.

@markus101 - here you go

If you run that script outside of Sonarr does it execute properly? You’d need to pass the variables to it as environment variables. I believe you do that with env sonarr_eventtype="test", but it’s been a while since I’ve done that.

The exit code is coming from outside of Sonarr, but not sure if there is a defined error the exit code 255 refers to.

Will do - I’ve disabled change category so I can catch a few downloads and see what happens if I run the script manually. Will report back.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.