Jump to content


Photo

Script autostart but freeze image on boot


  • Please log in to reply
7 replies to this topic

#1 CloudItaly

  • Senior Member
  • 195 posts

+1
Neutral

Posted 31 August 2014 - 00:09

Hi, 

I create this simple script that I call ping.sh:

 

#!/bin/bash
while [ 1 ]; do
/bin/ping -s 1024 google.com
done

I need that this script when I turn on the box so, i can add ping.sh to /etc/init.d/ with 755 and give this command: 

ln -s /etc/init.d/ping.sh /etc/rc3.d/S90ping.sh (S90ping.sh has 755).

 

When i reboot the box, the OpenPli don't run, I see only the bootscreen/wallpaper but the load spinner don't appear and don't load. If I delete this file ping.sh and S90ping.sh, the OpenPli load correctly.

I need that this script start automatically when turn on the box. How can do?

 



Re: Script autostart but freeze image on boot #2 hemispherical1

  • Senior Member
  • 1,596 posts

+49
Good

Posted 31 August 2014 - 01:37

Guessing maybe add a -c flag so it doesn't ping forever and the script can exit?

 

/bin/ping -c 1 -s 1024 google.com

 

for 1 ping, etc...

 

 

Good luck,

--

hemi



Re: Script autostart but freeze image on boot #3 CloudItaly

  • Senior Member
  • 195 posts

+1
Neutral

Posted 31 August 2014 - 06:02

Guessing maybe add a -c flag so it doesn't ping forever and the script can exit?

 

/bin/ping -c 1 -s 1024 google.com

 

for 1 ping, etc...

 

 

Good luck,

--

hemi

 

I need a ping forever and continuous  because is a mobile connection and I found this fix to force H+ mode instead 3G. 
So i need to exec this ping.sh on boot. 

 

I think that the image during the startup, check and exec all *.sh to start and when read the ping.sh, it freeze because there isn't "exit"/"done" command. So how can start this script?  



Re: Script autostart but freeze image on boot #4 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 31 August 2014 - 08:08

Yes, all scripts are executed one after the other. Your script don't end, so next script us not executed.

I think you need 2 scripts. One with the loop. Call it ping_loop.sh or something like that. Then execute in the S90ping.sh

#!/bin/bash

nohup <path>/ping_loop.sh &

That starts script in background.
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Script autostart but freeze image on boot #5 mika-nl

  • Senior Member
  • 454 posts

+10
Neutral

Posted 31 August 2014 - 12:45

Yes, all scripts are executed one after the other. Your script don't end, so next script us not executed.

I think you need 2 scripts. One with the loop. Call it ping_loop.sh or something like that. Then execute in the S90ping.sh

#!/bin/bash

nohup <path>/ping_loop.sh &

That starts script in background.

 

Why not like this then ? :

 

#!/bin/bash
while [ 1 ]; do
nohup /bin/ping -s 1024 google.com >& /dev/null &

done


					
					

Re: Script autostart but freeze image on boot #6 MiLo

  • PLi® Core member
  • 14,045 posts

+298
Excellent

Posted 31 August 2014 - 13:08

That's a fork bomb.
Real musicians never die - they just decompose

Re: Script autostart but freeze image on boot #7 betacentauri

  • PLi® Core member
  • 7,185 posts

+323
Excellent

Posted 31 August 2014 - 13:50

Because your script will never end. And it will start ping processes until all system resources are gone.
You want only one ping process which is running all the time.
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Script autostart but freeze image on boot #8 Erik Slagter

  • PLi® Core member
  • 46,960 posts

+541
Excellent

Posted 31 August 2014 - 15:01

I don't understand the issue. The whole idea of HDSPA is that it dynamically switches between "normal" (3G) and "quick" modes (HDSPA) whenever it needs, to distribute bandwidth between users in a fair way (not allocating resources on the local radio controller when it's not used) AND also "3G" uses less battery than "H", so it's a win-win situation.


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users