Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 12 Nov 2019, 06:27
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How can I make sure network connects before browser starts?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
B.K. Johnson

Joined: 12 Oct 2009
Posts: 773

PostPosted: Fri 18 Oct 2019, 11:21    Post subject:  How can I make sure network connects before browser starts?
Subject description: Solved
 

Just a little personal irritant in need of a solution.
Scenario
I have a little script in Startup that auto-loads Firefox.
My Firefox config keeps the last set of tabs (when session is saved).
Frisbee (but I suspect all network managers) are invoked before the script in Startup.
Consequently, ALL the Firefox tabs with internet web pages show Server Not Found.
Question
Is there a way to reverse the order of processing, i.e. so that the script directive is invoked after the network app connects?

upupbb32, firefox 69.0.3
see sig for other details
netwkb4fox.png
 Description   firefox tabs with Server Not Found
 Filesize   23.62 KB
 Viewed   32 Time(s)

netwkb4fox.png


_________________
B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM


Last edited by B.K. Johnson on Tue 22 Oct 2019, 12:05; edited 1 time in total
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 12825
Location: S.C. USA

PostPosted: Fri 18 Oct 2019, 11:38    Post subject:  

Maybe put a sleep command at the start of the script.

The script is activated, but it sleeps for a period of time before it actually does anything.

How to Use the Linux Sleep Command to Pause a BASH Script
https://www.lifewire.com/use-linux-sleep-command-3572060

Network connection does take some time to complete.
Wired connection is usually quick.
Wireless takes some time.
I usually get to a working desktop and 10 to 30 seconds later the connection is made.

_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer) http://www.murga-linux.com/puppy/viewtopic.php?t=107601
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 975

PostPosted: Fri 18 Oct 2019, 11:59    Post subject:  

This script will loop until WAN becomes available:
Code:
#! /bin/bash
PINGHOST="1.1.1.1"

while :
do
   RTN=$(ping -c 1 -w 2 -n $PINGHOST | grep "from")

   if  [ -z "$RTN" ]
     then   
      sleep 1
     else
      break
   fi
done

#startbrowser

.
Back to top
View user's profile Send private message 
B.K. Johnson

Joined: 12 Oct 2009
Posts: 773

PostPosted: Fri 18 Oct 2019, 12:12    Post subject:  

@bigpup, @jafadmin

Thanks guys.
[EDIT]
Sleep worked. Initial setting of 60 may have been too long. Think I'll try jafadmin's rather than fiddling with the number for sleep.
[EDIT-2]
At first glance, the script seems to work also.

I'll mark the thread as SOLVED.

_________________
B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0352s ][ Queries: 12 (0.0089s) ][ GZIP on ]