0

I have the following desktop entry on my ~/.local/share/applications directory:

[Desktop Entry]

Type=Application
Version=1.0
Name=FetchSecurity
Exec="/home/user/Pictures/security/fetchSecurityCam.sh"
Terminal=false

And the following script:

#!/bin/sh

check=`echo "$1" | grep -E ^\-?[0-9]+$`

if [[ $# -eq 0  ]] ; then
    interval=300
elif [[ $check == '' ]] ; then
    echo "Not a number argument" $1
    exit
else
    interval = $1
fi

export OUTPUT=~/Pictures/security


watch -n $interval 'wget -O "$OUTPUT/cam_$(date +%F-%T).jpg" [MY SECURITY CAM IP] --user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"' &> /dev/null  &

The entry appears in Gnome apps but it doesn't run the script, what am I doing wrong?

The script works if it's run fromt a terminal.

3
  • The script runs fine. But you do not see the error message. Change the Terminal=false option to true, add a sufficiently long sleep before the exit and you will see error message "Not a number argument"
    – White Owl
    Mar 13 at 22:14
  • I've made the modifications and the terminal doesn't show up. Mar 14 at 19:32
  • Replace Exec statement with Exec="xterm -hold -e /home/user/Pictures/security/fetchSecurityCam.sh"
    – White Owl
    Mar 14 at 19:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.