Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jnweiger
jw-env
google.pl
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File google.pl of Package jw-env
#! /usr/bin/perl # # a script to connect to the internet via modem, so that # konqueror can show the google webpage my $test_cmd = 'cinternet -i modem0 -l | tail -n 1'; my $start_cmd = 'cinternet -i modem0 -A'; my $stop_cmd = 'cinternet -i modem0 -O'; my $start_count = 0; my $wait_count = 0; my $start_count_max = 20; # number of retries. my $last = ''; my $repeat = 0; select STDOUT; $|++; for my $i (0..1000) { my $a = `$test_cmd`; chomp $a; if ($last eq $a) { $wait_count += 3; printf "(%d) $a\r", ++$repeat, $a; } else { $repeat = 0; $last = $a; print "\n $a\r"; } if ($a =~ m{^Status is: connected}) { print "\n"; last; } $wait_count = 9999 if $a =~ m{^pppd\S+ died:}; if ($wait_count++ > 100) { $wait_count = 0; last if $start_count++ >= $start_count_max; system($stop_cmd); sleep(3); system($start_cmd); printf "\nRestart %d/%d: $start_cmd\n", $start_count, $start_count_max; } sleep(3); } sleep(3); system("konqueror http://www.google.de &"); ## if ping cannot start, we exit here which also kills the browser. ## if the connection works and ping fails later, it does not exit. system("ping -i 5 131.188.34.77");
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor