Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I never wrote a script though .... however I have this textfile with 'pppd call name'
how do I make it a bash script
how do I use it then and how do I disconnect?
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
a script is just a command or set of commands that run by running the
name of the script.
chmod +x nameofscript
mades it an executable script.
make another one for what you need to do to hang up, and do the same thing to it.
what i gave you in the previous response will work, and you can change whatever
names and paths you wish.
cat >> /usr/local/bin/getoninternet # here cat just means add the following test the the fileename shown
pppd call name # this is the text added to the file
control-d # this means stop adding text and close the file
chmod +x /usr/local/bin/getoninternet # this means make the file executable so it will run when you type the name of it.
you can just as easily do that with a text editor, then save the file by whatever name you wish, just putting it somewhere in your search path. /usr/local/bin is good
then make it executable with chmod +x nameandpathoffile
then you can type the name of the file, and the commands in it will be run.
make another for your hangup script.
>chmod +x nameofscript
>mades it an executable script.
so why does it show me whats in there when I click on it? (it shows me the text)
to hang up I need to type in 'ps aux | grep pppd' than it shows me several process numbers from which I should chose the right one to "kill number' it then.
Can I do that with a script....
I would use kppp, but it does not support my internet connection
I had a similar problem when trying to see when my pptp pppd tunnel was dying (didn't want to killall -9 pppd as the ADSL connection was still running):
PS: I stuck this in /etc/cron.2minutes
#!/usr/bin/perl
##############################################################################
# Check VPN PPTP Link Utility Version 1.0 #
# Copyright 2004 David Herselman (dh@syrex.cc) #
# Created 09/03/2004 Last Modified 10/03/2004 #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 2004 David Herselman All Rights Reserve #
# #
# Selling the code for this program without prior written consent is #
# expressly forbidden. In other words, please ask first before you try and #
# make money off of my program. #
# #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium. In all cases copyright and header must remain intact.#
##############################################################################
# Define Variables #
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.