Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is possible an menu launcher to run an bash script ? #166

Open
Augusto7743 opened this issue Jun 28, 2023 · 5 comments
Open

Is possible an menu launcher to run an bash script ? #166

Augusto7743 opened this issue Jun 28, 2023 · 5 comments

Comments

@Augusto7743
Copy link

Hello.
Thanks for reading my topic.
Is possible use MenuLibre to create an menu launcher to run an bash script ?
bash script file have the command to flush writeback cache before OS log out or power off.

/usr/sbin/dmsetup message /dev/mapper/rc-wb_sda4 0 flush

the command need to run being sudo.

I had created an launcher pointing to the bash file and selecting to run in terminal , but not work.

Thanks for any reply.
Have an nice week.

@q962
Copy link

q962 commented Jul 24, 2023

Is there somewhere I can enter the password for sudo?
So you should set proper permission for your script and then execute it. Have you tried it?
or use pkexec as the launcher

@Augusto7743
Copy link
Author

I want create an shortcut launch being possible run "bash" with script.
One launch link with sudo bash running an script and other without sudo.

@q962
Copy link

q962 commented Dec 7, 2023

I've given the tips, have you tried them?

1.SUID
2. pkexec

Does not involve sudo command

@MeatImp
Copy link

MeatImp commented Jan 26, 2024

Make the first line of your script
#!/bin/bash

This is not a menu issue, if this corrects your issue pleas mark it as closed.

@rwperrott
Copy link

Make the first line of your script #!/bin/bash

Solution

I adapter the example in man pkexec, so:
Change

#!/bin/bash

becomes:

#!/usr/bin/pkexec /usr/bin/bash

pkexec effectively does cd /root; if that causes problems, try:

#!/usr/bin/pkexec --keep-cwf /usr/bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants