Script creating help appreciated

There are 13 replies in this Thread which was already clicked 810 times. The last Post () by ddinc.

  • I need a script or plugin to execute"systemctl stop oscam_11704" command with the Dreambox remote(OS2.5)

    I found a script but it's from an old thread and I don't know whether compatible

    Don't need a cronjob as I need it once a week or so.

    (reason:half of clients suddenly off......restored by this command)


    /usr/lib/enigma2/python/Plugins/Extensions/ExecuteMyScript/plugin.py


    Python

    Edited once, last by ddinc ().

  • You already have a thread on the go around this question.
    Oscam telnet command for stopping

    but if you are only asking what your script file will look like, then it will look something similar to this but use whatever commands you decided worked from your original thread. Make sure you use a text editor that allows you to specify the line endings. (i.e Notepad++). The EOL conversion needs to be Unix and not Windows. And your script file needs execute permissions. Which you can set in an ftp program.


    Bash
    #!/bin/sh
    #
    
    /etc/init.d/softcam stop
    /etc/init.d/softcam start
    exit 0


    The plugin code you have attached is perfectly fine and just a shell to run a script called "ExcuteMyScript.sh"


    so you would have


    /usr/script/ExcuteMyScript.sh with the script code code similar to above

    your plugin.py as you have shown would live in

    /usr/lib/enigma2/python/Plugins/Extensions/ExecuteMyScript/
    and you just put a blank __init__.py file in the same folder

    ** A person who feels appreciated will always do more than what is expected **

  • Hi.


    The problem was also that there is no bash interpreter in your system. There is only a sh interpreter. Some old Enigma2 distributions do not contain a bash interpreter or a symbolic link from Bash to a built-in interpreter (for example: Sh, Ash, Zsh, ...). In your new script, I see the use of sh and not bash. So it worked out and that was probably the cause of the problem: bad interpreter


    The error ^M was probably incorrect character encoding. Today, UTF-8 is widely used almost everywhere. ANSI encoding is no longer used anywhere. Maybe only in very old systems.


    / EDIT:


    Btw, in Notepad++, I recommend activating the bottom status bar. In it, you can see position of the line on which you currently are... or how many characters are marked... and so on. You will also see the Unix / Windows line-ending in the bottom bar, and you can change the line-ending directly by clicking on it (right mouse button), in the bottom status bar.

  • master G

    Set the Label from OSCam Scripts to Scripts OSCam

OSCam Support Forum

Configs, discussion, downloads and guides for OSCam Softcam.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!