Jump to content

launching my internet connection [Solved]


Hemtah
 Share

Recommended Posts

hi,

 

don't know if this go on hardware or software

 

i am using accessrunner with a usb modem

 

to start my internet connection i have to type su and cxstart.sh on the command line,

 

how can i have my internet connection start while linux starts?

 

thanks

Edited by Hemtah
Link to comment
Share on other sites

Everything which is automatically started is in a directory called

/etc/init.d

Now hopefully there is a stub of a script here.... that you can use that relates to your service..

 

Have a look or post the contents here so we can see,,,,

after that you make a link to it in the directories

/etc/rcx.d (where x is a number 0-5)

 

that can be done easily using a script called chkconfig ..but first show us what the script is then we can have a look ....

 

its not difficult but its easier to expllain if we know we have the right file..

 

if it doesn't exist we can make one from the cxstart.sh so all it not lost :D

Link to comment
Share on other sites

well well, i am newbie on mandrake linux and i am just doing the full transition from windows to linux :cheeky:

 

so in my dir /etc/init.d

 

i have

 

alsa harddrake mandrake_everytime nfs proftpd usb

atd hotplug mandrake_firstime nfslock rawdevices xfs

cpufreq httpd messagebus numlock single xinetd

crond keytable mtink oki4daemon smb

dkms kheader mysql partmon sound

dm killall netfs portmap sshd

functions mailman netplugd postfix syslog

halt mandrake_consmap network postgresql udev

 

but which one to use?

Link to comment
Share on other sites

The .sh file is the same as a batch file....

 

hint... you can use the middle mouse button to copy and paste highlighted text to you can

 

ls /etc/init.d ...then use the middle mouse to copy it and save typing :D

 

if you find the file cxstart.sh (whereis cxstart.sh) then

cat /pathtofile/cxstart.sh ...

it should show up in the terminal..... can you copy and paste it... ?

 

we can do the other way with an icon but it will depend which window manager you are using etc. and your first instainct was a better neater way :D

indeed once you have that it is called a service .. and you can use the service to stop or start it.

Link to comment
Share on other sites

well, still hace trouble with my firefox shortcut, need to find out which file to link to the shortcut

i have rebooted but i am not connected, i have to do it manually.

 

here is the file

 

#!/bin/bash

TEXTDOMAIN=`basename $0`
#if [ -d "./locale" ]; then
#  TEXTDOMAINDIR="./locale"
#fi

. /etc/cxacru

cxload.sh || exit 1

if [ "$1" = "service" ]; then
 if [ -d /var/lock/subsys ]; then
   touch /var/lock/subsys/cxacru
 fi
fi

if [ "$PROTOCOL_MODE" = "" ]; then
 echo $"Error: PROTOCOL_MODE not defined" 1>&2
 exit 1
else
 if [ "$PROTOCOL_MODE" -eq 1 ]; then
   echo $"Setting RFC1483/2684 routed..." 
   cxnetup.sh || exit 1
 else
   if [ "$PROTOCOL_MODE" -eq 2 ]; then
     echo $"Setting PPP over ATM..."
     cxnet2up.sh || exit 1
   else
     if [ "$PROTOCOL_MODE" -eq 3 ]; then
       echo $"Setting RFC1483/2684 bridged..."
       cxnet3up.sh || exit 1
     else
       if [ "$PROTOCOL_MODE" -eq 4 ]; then
         echo $"Setting PPP over Ethernet..."
         cxnet4up.sh || exit 1
       else
         echo $"Error: unknow protocol mode" 1>&2
         exit 1
       fi
     fi
   fi
 fi
fi

Link to comment
Share on other sites

OK that looks OK...

If you know which protocol you use we could simplify it though :D

 

However if you copy this into the /etc/init.d directory then you should be able to use chkinstall to set which runlevels

 

It needs some work because it should also have a stop...

 

we can then use this in the icon with a script like

#/bin/bash

#start/stop internet

if [/var/log/sussys/cxacru ]

cxload.sh

else

cxunload.sh

fi

 

This sees if the lock file exists and runs a file I called cxunload.sh to stop it so the same icon will start and stop the service...

 

Can you post the contents of cxstart.sh

 

also do this (as root in CLI)

updatedb

locate cx

 

This will find anything else with cx.. (this file needs to be in the path)

hopefully a cxunload.sh (or similar already exists :D) and we can use this ...

Link to comment
Share on other sites

thanks again for helping me

 

well:

 

the protocol i use is pppoatm

 

there is file called cxnet2down.sh which is adviced to be used to shutdown the net connetion

 

#!/bin/bash

TEXTDOMAIN=`basename $0`
#if [ -d "./locale" ]; then
#  TEXTDOMAINDIR="./locale"
#fi

echo $">>> Down PPPoA network interface <<<"
echo

pid=`pidof pppd`
if [ "$pid" != "" ]; then
 echo $">>> Killing pppd daemon..."
 killall pppd
 echo
fi

if lsmod | cut -d' ' -f1 | grep -q -E "^cxacru|cxacrudbg$"; then
 echo $">>> Stopping transfers..."
 cxioctl 2
 echo
fi

Link to comment
Share on other sites

I didn't get hoe last night! Live music then stopped at friends so sorry I didn't get nback...

 

(p.s. anyone else wanna step in gfeel free else Ill try later)

to anyone who might help before I get chance)

My idea is just make a initd service from this with the start/stop/etc.

 

use chkconfig to add the service to RL2-5 and appopriate kill services ...

then also add a script that turns it off if its on on on of its off based on lock file!

Link to comment
Share on other sites

i think u forgot that i am a newbiiie

:cheeky:

Nope I was posting that so someone else will be able to follow where I was going. Hopefully helping you quicker since I need to get home to check...

(I don't wanna tell you wrong and screw something up so I wanna test it on my machine 1st ).. but someone else might be able to help you sooner so I posted where I was aiming for...

 

Thats why I added it all underneath... don't worry about understanding it :D

(at least not yet)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...