Author Topic: Unable to get script working when I need it to  (Read 1136 times)

0 Members and 1 Guest are viewing this topic.

Offline pooky2483

  • Hero Member
  • *****
  • Posts: 2067
  • Karma: 0
  • Gender: Male
  • Slowly getting the hang of it.
    • View Profile
    • Get your FREE Ubuntu stickers here. I'm the UK address
    • Awards
Unable to get script working when I need it to
« on: September 13, 2018, 04:52:10 pm »
I'm trying to get a script to work on boot, but I'm having problems.
I want the script to execute after I have got an internet connection as they will be useless if executed before.

I want the script to do three things;
1 connect to a VPN
2 start onedrive (using dolphin, I can access my MS OneDrive folder(s)
3 start GoogleDrive (same as #2)

Yet, when the script is run, nothing happens.
The script

#!/bin/bash
sleep 30
expressvpn connect ukdo
onedrive-d start
google-drive-ocamlfuse /media/pooky2483/EXT-05-8Tb/Google-Drive/

I would also like to be notified which command is being executed, possibly by way of some kind of on-screen message.

Kubuntu 16.04LTS 64bit|KDE 4.14.13|QT 4.8.6|Linux 4.15.0-32-generic|M5A78L-M USB3|BIOS 2101|AMD PhenomII X4 965 3400+|P8H77-I Motherboard NIC|32.0GB PC3-10600 1333Mhz CL9 ( 9-9-9-24 ) DDR3

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17934
  • Karma: 461
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Unable to get script working when I need it to
« Reply #1 on: September 13, 2018, 05:29:08 pm »
does running those 4 commands work if run manually one after the other in a terminal ?

and does Kubuntu use "konsole" as the terminal ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline pooky2483

  • Hero Member
  • *****
  • Posts: 2067
  • Karma: 0
  • Gender: Male
  • Slowly getting the hang of it.
    • View Profile
    • Get your FREE Ubuntu stickers here. I'm the UK address
    • Awards
Re: Unable to get script working when I need it to
« Reply #2 on: September 13, 2018, 06:25:59 pm »
does running those 4 commands work if run manually one after the other in a terminal ?

Yes

Quote
and does Kubuntu use "konsole" as the terminal ?

Yes

Kubuntu 16.04LTS 64bit|KDE 4.14.13|QT 4.8.6|Linux 4.15.0-32-generic|M5A78L-M USB3|BIOS 2101|AMD PhenomII X4 965 3400+|P8H77-I Motherboard NIC|32.0GB PC3-10600 1333Mhz CL9 ( 9-9-9-24 ) DDR3

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 17934
  • Karma: 461
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Unable to get script working when I need it to
« Reply #3 on: September 23, 2018, 08:50:08 pm »
Why not add the lines one at a time to your script

so
Code: [Select]
#!/bin/bash
sleep 30
expressvpn connect ukdo
run the script and see if it connects to expressvpn

if it does, make it read
Code: [Select]
#!/bin/bash
sleep 30
expressvpn connect ukdo
onedrive-d start
and if that works
Code: [Select]
#!/bin/bash
sleep 30
expressvpn connect ukdo
onedrive-d start
google-drive-ocamlfuse /media/pooky2483/EXT-05-8Tb/Google-Drive/
to get an idea where it's failing.

do any of those commands require elevated permissions ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline pooky2483

  • Hero Member
  • *****
  • Posts: 2067
  • Karma: 0
  • Gender: Male
  • Slowly getting the hang of it.
    • View Profile
    • Get your FREE Ubuntu stickers here. I'm the UK address
    • Awards
Re: Unable to get script working when I need it to
« Reply #4 on: September 29, 2018, 04:48:07 pm »
I've discovered that expressvpn has a command which I can set so it automatically connects when it gets an internet conenction, so I can drop that one from the script.
I think I'll have to find out how long it takes for my PC to boot up and obtain a connection, then adjust the 'sleep' accordingly.

I'll have another go when I've finished backing up all my files.... May be a little while.....

Kubuntu 16.04LTS 64bit|KDE 4.14.13|QT 4.8.6|Linux 4.15.0-32-generic|M5A78L-M USB3|BIOS 2101|AMD PhenomII X4 965 3400+|P8H77-I Motherboard NIC|32.0GB PC3-10600 1333Mhz CL9 ( 9-9-9-24 ) DDR3

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal