title: "stdin: is not a tty" from cronjob
body: <p>I'm getting the following mail every time I execute a specific cronjob. The called script runs fine when I'm calling it directly and even from cron. So the message I get is not an actual error, since the script does exactly what it is supposed to do.</p>
  
  <p>Here is the cron.d entry:</p>
  
  <pre><code>* *     * * *     root   /bin/bash -l -c "/opt/get.sh &gt; /tmp/file"
  </code></pre>
  
  <p>and the get.sh script itself:</p>
  
  <pre><code>#!/bin/sh
  
  #group and url
  groups="foo"
  
  url="https://somehost.test/get.php?groups=${groups}"
  
  # encryption
  pass='bar'
  method='aes-256-xts'
  pass=$(echo -n $pass | xxd -ps | sed 's/[[:xdigit:]]\{2\}/&amp;/g')
  
  encrypted=$(wget -qO- ${url})
  decoded=$(echo -n $encrypted | awk -F '#' '{print $1}')
  iv=$(echo $encrypted | awk -F '#' '{print $2}' |base64 --decode | xxd -ps | sed 's/[[:xdigit:]]\{2\}/&amp;/g')
  
  # base64 decode input and save to file
  output=$(echo -n $decoded | base64 --decode | openssl enc -${method} -d -nosalt -nopad -K ${pass} -iv ${iv})
  
  if [ ! -z "${output}" ]; then
          echo "${output}"
  else
          echo "Error while getting information"
  fi
  </code></pre>
  
  <p>When I'm not using the <code>bash -l</code> syntax the script hangs during the wget process. So my guess would be that it has something to do with wget and putting the output to stdout. But I have no idea how to fix it.</p>