0

How can I create a text file to automatically run these commands:

sudo ap-hotspot start
sudo ap-hotspot configure
sudo ap-hotspot stop
sudo ap-hotspot restart

One file for each command.

I tried with creating a file ".sh" that contains:

#!/bin/bash
ap-hotspot start

Also used:

chown root:root <start-a-p>.sh
chmod 4755 <start-a-p>.sh

to give permissions.

But it doesn't work. Any other suggestions?

1 Answers1

0

Try with following content in script (.sh)

#!/bin/bash
sudo /bin/bash -c "ap-hotspot start"

Make it a script by executing chmod +x filename.sh

and run it if you are in parent folder ./filename.sh or full path.

Web-E
  • 21,716