PINE64
Terminal help - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Mobian on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=139)
+---- Thread: Terminal help (/showthread.php?tid=11906)



Terminal help - noob444 - 10-22-2020

Hi all!

I've been using Mobian on a Braveheart for a while now and I'm really impressed with the project so far.

My plan right now is to write some simple bash scripts for various purposes. I'm sure it's documented somewhere but I figured I ask here first. I would be very happy if some of you Linux experts out there could help me out.

How do I toggle the following functionalities (devices) on or off only using the Kings cross terminal:

1) Wifi?
2) Bluetooth?
3) Modem?
4) LTE?


RE: Terminal help - Cree - 10-22-2020

Not really my expertise so i may be ignorant in saying this, however it may be similar to enabling gps through terminal in UT. There's a post on that that goes through it line by line. Might be a similar process for the other tools, and Ubuntu is debian based.


RE: Terminal help - RTP - 10-23-2020

(10-22-2020, 02:51 PM)noob444 Wrote: Hi all!

I've been using Mobian on a Braveheart for a while now and I'm really impressed with the project so far.

My plan right now is to write some simple bash scripts for various purposes. I'm sure it's documented somewhere but I figured I ask here first. I would be very happy if some of you Linux experts out there could help me out.

How do I toggle the following functionalities (devices) on or off only using the Kings cross terminal:

1) Wifi?
2) Bluetooth?
3) Modem?
4) LTE?

Code:
sudo ip link set NetworkCardName down


to set device down (replacing NetworkCardName with name of your device)

Code:
sudo ip link set NetworkCardName up


to bring up.

The ip command is very powerful. You should take a look at the manual pages (man ip) to get a better idea of all of it's capabilities. 

Here is a good guide https://upload.wikimedia.org/wikipedia/commons/8/81/BourneShellScripting.pdf


RE: Terminal help - noob444 - 10-23-2020

@Cree. Thanks, I have been able to pull most of these things off in UBports. But the scripts I've already created don't seem to work out of the box in Mobian. Thank you also for bringing up GPS, because I simply forgot about it. It would also be great to have the ability to toggle the GPS on/off in the terminal.

@RTP. Thanks alot! I will definetely try your code and read up on the ip command. I really appeciate it.


RE: Terminal help - wibble - 10-25-2020

There's a fair bit of detail about the GPS in the mobian wiki. Adding upload of AGPS data will make it a lot more usable.
https://wiki.mobian-project.org/doku.php?id=location