[OpenWrt-Users] How to execute python script in rpc shell script

2018-02-14 Thread Phani Siriki
Hi All I want to execute my custom python scripts in rpc shell script. However, they are not executed. Could someone help me on this? *Example Python script:* *===* root@OpenWrt:~# cat hello.py from subprocess import call call(["touch", "/root/ap1", "down"]) print

Re: [OpenWrt-Users] How to execute python script in rpc shell script

2018-02-14 Thread Saverio Proto
Add something like: #!/usr/bin/env python at the first line of your python script bash script has #!/bin/sh, so it is correctly detected it is shell script but for the python code you did not specify any shebang Saverio 2018-02-14 19:11 GMT+01:00 Phani Siriki : > Hi All

Re: [OpenWrt-Users] How to execute python script in rpc shell script

2018-02-14 Thread Lars Kruse
Hello Phani, Am Wed, 14 Feb 2018 12:11:16 -0600 schrieb Phani Siriki : > I want to execute my custom python scripts in rpc shell script. However, > they are not executed. Could someone help me on this? I am not familiar with the details of the rpcd insterface you are

Re: [OpenWrt-Users] How to execute python script in rpc shell script

2018-02-14 Thread Lars Kruse
Hello Saverio, Am Wed, 14 Feb 2018 21:43:46 +0100 schrieb Saverio Proto : > Add something like: > > #!/usr/bin/env python > > at the first line of your python script in this specific case it is not relevant, since he is calling the interpreter with the script filename as

Re: [OpenWrt-Users] Pip command found error even though pip is installed

2018-02-14 Thread Phani Siriki
Hi Lars I am now facing problem with python on a different router. I have installed python on USB stick and I could not execute it. oot@Mesh-30:~# df -h FilesystemSize Used Available Use% Mounted on /dev/root 4.8M 4.8M 0 100% /rom tmpfs

Re: [OpenWrt-Users] How to execute python script in rpc shell script

2018-02-14 Thread Phani Siriki
Hi Saverio I tried as suggested. It didn't work :( Best Regards Phani On Wed, Feb 14, 2018 at 2:43 PM, Saverio Proto wrote: > Add something like: > > #!/usr/bin/env python > > at the first line of your python script > > bash script has #!/bin/sh, so it is correctly

Re: [OpenWrt-Users] Pip command found error even though pip is installed

2018-02-14 Thread Lars Kruse
Hello Phani, Am Wed, 14 Feb 2018 15:00:34 -0600 schrieb Phani Siriki : > root@Mesh-30:~# python > -ash: python: not found I guess, this means that one of the libraries that the python binary is linked against, is missing. Maybe run "ldd /usr/bin/python" and check if all

Re: [OpenWrt-Users] Pip command found error even though pip is installed

2018-02-14 Thread Phani Siriki
Hi Lars You are correct. There are some relocation errors, Could you give me some pointers on how to resolve this? root@Mesh-30:~# ldd /usr/bin/python /lib/ld-uClibc.so.0 (0x55566000) libpython2.7.so.1.0 => /mnt/usb/usr/lib/libpython2.7.so.1.0 (0x77c9e000) libpthread.so.0

Re: [OpenWrt-Users] How to execute python script in rpc shell script

2018-02-14 Thread Greg Oliver
On Wed, Feb 14, 2018 at 3:27 PM, Phani Siriki wrote: > Hi Saverio > > I tried as suggested. It didn't work :( > > Best Regards > Phani > > On Wed, Feb 14, 2018 at 2:43 PM, Saverio Proto wrote: > >> Add something like: >> >> #!/usr/bin/env python >> >>