Syntax error in Suspend/Resume Script

  • I hope this is a simple one. I'm very new to linux so i'm probably doing something stupid, please help :)


    I am currently trying to create a script to refresh my dvbsky drivers on resume, currently on resume I get 'not tuner available' error.


    I have created the following script here /storage/.config/sleep.d. But on resume/sleep I get the following errors Jul 12 11:13:52 media systemd-sleep[1159]: /storage/.config/sleep.d/01-dvb.power: line 3: syntax error: unexpected word (expecting "in")


    This is the script, any help would be greatly appreciated.

  • Save the file in UNIX format (not DOS).

    Or convert it with dos2unix program:

    Code
    1. dos2unix /storage/.config/sleep.d/01-dvb.power

    Blu-ray Disc Java menus support - forum thread, Github

    my lamp addon (unofficial/community) (limited no support)
    my touchscreen support and instructions by Grruhn (now touchscreen addon exists in repository)

  • Save the file in UNIX format (not DOS).

    Thanks! that did the trick, it's now working. I ended up using the 'EOL Conversion' option in notepad++ to convert to unix format.

  • Can I just churp in on this for some advice?


    I'm wanting to restart LE when the machine resumes from suspend.


    I've created a file named 01-restart.power with:

    Shell-Script
    1. #!/bin/sh
    2. case "$1" in
    3. pre)
    4. ;;
    5. post)
    6. systemctl restart kodi
    7. ;;
    8. esac

    Only issue is that I dont have a /storage/.config/sleep.d/ so I created it and placed the file in there but nothing happens. I've done as above and made sure it is a unix script.


    I do see a /storage/.config/sleep.conf.d/ but placing the file in there makes no difference either.


    Any help would be greatly appreciated.


    Thanks