Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
The 3 commands work fine in a terminal, but the third one does not execute in my script. (This script is in my startup folder; the delay is necessary to allow time for my laptop to connect to the 'net.)
Distribution: Puppy; A/V Linux for playing live synth
Posts: 23
Original Poster
Rep:
Thanks Evo --
Just for the record, were i to call myself a Bash neophyte, i'd be bragging.
I copied your suggested script into the file in place of what i had -- nothing printed.
What i mean by "does not execute" is that i checked my IP address and it had not changed. I entered that last command to start the vpn service and it connected without complaining that my ipv6 service hadn't started like it would had i just booted up. So i know that the first two commands are carried out but not the third.
It's getting really late here on the east coast (US) and i'm seriously shorting myself of needed sleep, so I'll be offline until after work tomorrow. Thanks.
Last edited by Subito Piano; 06-25-2019 at 11:37 PM.
Just for the record, were i to call myself a Bash neophyte, i'd be bragging.
I copied your suggested script into the file in place of what i had -- nothing printed.
Did you actually run the script? If so, how?
Quote:
Originally Posted by Subito Piano
What i mean by "does not execute" is that i checked my IP address and it had not changed. I entered that last command to start the vpn service and it connected without complaining that my ipv6 service hadn't started like it would had i just booted up. So i know that the first two commands are carried out but not the third.
It's getting really late here on the east coast (US) and i'm seriously shorting myself of needed sleep, so I'll be offline until after work tomorrow.
I think you need to try running the script from the terminal and look at the output.
Distribution: Puppy; A/V Linux for playing live synth
Posts: 23
Original Poster
Rep:
Thanks, ondoho --
Yeah, "servername" was just my substitute for the actual servername. My syntax was incorrect, i only needed "pvnp -l" to connect to the previously-chosen server, but that's not my problem anyway.
I ran your script -- no output. That's the thing. I can run the commands in terminal -- no problem. I can reboot and click on the script, and it executes. However, when i place the script in my startup folder, it does not automatically execute. I can place it in /usr/bin and symlink it (which i've never had to do anyway) -- and still no go upon reboot. So the real issue is why this particular script won't autostart -- just that last line telling it to connect. The first two lines definitly kick in. I have several custom scripts in that folder or symlinked to it, and i've never run into this issue before, not even when there is a sleep command upfront.
Running xenialpup linux on a sturdy old Lenovo/IBM T60. (And yes, it is stamped with BOTH manufacturer's names!)
Last edited by Subito Piano; 06-26-2019 at 03:34 PM.
Thanks, ondoho --
Yeah, "servername" was just my substitute for the actual servername. My syntax was incorrect, i only needed "pvnp -l" to connect to the previously-chosen server, but that's not my problem anyway.
I ran your script -- no output.
Really? You ran a script that has echo statements, and there was no output? Exactly what did you do to run it?
Quote:
Originally Posted by Subito Piano
That's the thing. I can run the commands in terminal -- no problem. I can reboot and click on the script, and it executes. However, when i place the script in my startup folder, it does not automatically execute. I can place it in /usr/bin and symlink it (which i've never had to do anyway) -- and still no go upon reboot. So the real issue is why this particular script won't autostart -- just that last line telling it to connect. The first two lines definitly kick in. I have several custom scripts in that folder or symlinked to it, and i've never run into this issue before, not even when there is a sleep command upfront.
Running xenialpup linux on a sturdy old Lenovo/IBM T60. (And yes, it is stamped with BOTH manufacturer's names!)
What is "my startup folder"? Why are you expecting this script to be run automatically when your machine boots?
Distribution: Puppy; A/V Linux for playing live synth
Posts: 23
Original Poster
Rep:
Oops! Silly me -- i copied and pasted everything including the shebang.
OK -- here is the output:
Code:
sh-4.3# sleep 30
sleep 30
+ sleep 30
sh-4.3# modprobe ipv6
modprobe ipv6
+ modprobe ipv6
sh-4.3# modprobe tun
modprobe tun
+ modprobe tun
sh-4.3# pvpn -l servername tcp
It's stuck on the last line and does not execute it, i would need to manually hit ENTER.
Now, startup folders are a convenience for Puppy users. Anything we stick in there or link to it gets executed on startup....but not this script. Weird.
Oops! Silly me -- i copied and pasted everything including the shebang.
OK -- here is the output:
Code:
sh-4.3# sleep 30
sleep 30
+ sleep 30
sh-4.3# modprobe ipv6
modprobe ipv6
+ modprobe ipv6
sh-4.3# modprobe tun
modprobe tun
+ modprobe tun
sh-4.3# pvpn -l servername tcp
It's stuck on the last line and does not execute it, i would need to manually hit ENTER.
Now, startup folders are a convenience for Puppy users. Anything we stick in there or link to it gets executed on startup....but not this script. Weird.
It seems you do not understand what a script is.
Please do the following:
Copy the code from post #5 and paste it into a text editor window.
Then save the whole thing in a suitable folder (can be your home folder) under the name myvpn.sh
Now open a terminal in that folder, maximise it, and issue the following commands, one after the other, pressing <Enter> after each command:
Distribution: Puppy; A/V Linux for playing live synth
Posts: 23
Original Poster
Rep:
Thanks for the clear instructions, ondoho. Like i said, i'm definitely entry-level, but i did understand what you had me do -- except for looking up the "set" command and parameters. I've never had to use the sh extension to get a script running, though -- i just changed permissions and clicked on it and all was fine. Anyway, here is the output, after i changed the third line in my script to put in the absolute path and have it connect me to a particular server:
/usr/local/bin/protonvpn-cli and pvpn are two different commands. how on earth could their behaviour be the same?
anyhow, try to put US-NY#X in double quotes: "US-NY#X" or maybe even "US-NY#X tcp".
Distribution: Puppy; A/V Linux for playing live synth
Posts: 23
Original Poster
Rep:
Ah, my mistake -- i should have explained that "pvpn" is just a shortcut to protonvpn-cli. That shortcut came with the program; must be Proton figures that users would rather type 4 letters instead of 13....
Anyway, no go on the quotes. This has become one of those issues that i'm only hanging on to b/c i don't like not understanding things or admitting defeat. However, it's taking way too much of both my time and yours. I can just leave the shortcut on my desktop and click it after the desktop loads.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.