Hello I am trying to execute a sh
script via cronjob.
My script:
#!/bin/bash
#!/usr/bin/expect -f
IP=$(hostname -I | awk '{print $2}')
echo $IP
echo "Verbindung zum Server aufbauen"
So what I am trying to do is, I need the IP of my Raspberry Pi and start a server via ssh
. When I execute the script via terminal it works fine.
#!/bin/bash #!/usr/bin/expect -f
on the first line, which seems obviously wrong. – raj Jan 20 '21 at 21:23./script.sh
, orbash script.sh
, or whatever), and state which user you are when running the script via terminal. – AdminBee Jan 21 '21 at 10:01