Bash scripts

Hi there, not sure if i’m in the right place if not, i’m sorry.
Coming from windows I have been using EndeavorOS for a month now and I love it, really.
But since yesterday, my bash scripts aren’t behaving like they should.
For example, I have a very simple script called xtra.sh containing the following :

#!/bin/bash

sudo systemctl restart waydroid-container.service
waydroid app launch com.whatever.app

The script is executable and was running fine before when executed through Dolphin’s GUI : double click xtra.sh, select run and the prompt for the superuser password popped up.
image

(This is the prompt i’m used to and would like to get back)
image

Now it just skips everything related to “sudo” without even asking for a password and goes directly to the second command. This is the same for all my bash scripts using sudo, they don’t care for that password anymore and i’m left a bit confused.

Any ideas ? Thank you for reading.

sudo runs for the terminal. If you want that to work you have to open those in a terminal.

If you replace sudo with pkexec or run0 you will get a graphical prompt like you are expecting.

3 Likes

Replacing sudo with pkexec or run0 works, thank you !
I must say i feel like i’m going crazy since i was certain that using sudo was the way i used to run my scripts. I know that it works if i use konsole -e "sudo blabla" but don’t recall to be using that syntax. I guess my brain’s rotting.
Thank you for your help !

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.