Hey guys, I ‘m going crazy about this strange thing, when I create a custom aplication to run a script.sh. I double click on icon created for this custom aplication, and nothing happens. If I run the script form a terminal session, it runs perfectly. If I change the script to just “ls >test.txt”, it doesnt work from the desktop icon. I have recreated the profile with other name, I don’t know what else I can do, any idea??
Hey! Try to use /bin/bash /yourscript.sh
Does it work then?
No, no way, I have more scripts with an icon , they works perfectly. 😞
Did you checked the permissions? Change it to 777 for testing. If not, did you test the script as user user in terminal?
Would you mind to share the 2-3 first lines of your script?
Best practice would be to start a shell script with
#!/bin/bash
ls – l
this is my script: #!/bin/bash
# get info from xrandr
connectedOutputs=$(xrandr | grep ” connected” | sed -e “s/([A-Z0-9]+) connected.*/1/”)
activeOutput=$(xrandr | grep -E ” connected (primary )?[1-9]+” | sed -e “s/([A-Z0-9]+) connected.*/1/”)
for name in $connectedOutputs
do
if [ “$name” == “DP2” ];then
xrandr –output $name –mode 1360×768
elif [ “$name” == “HDMI1” ];then
xrandr –output $name –mode 1360×768
fi
done
this script does not work, with the desktop icon, but your script with xrandr is working well with the same desktop icon method
!/bin/bash
# SET Variables
INTERN=”eDP1″
EXTERN1=”DP1-2″
EXTERN2=”DP1-3″
#xrandr –output $INTERN –primary –output $EXTERN1 –off –output $EXTERN2 –off
xrandr –output $EXTERN2 –auto –output $EXTERN1 –pos 1280×0 –right-of $EXTERN1 –pos 1280×0 –output $INTERN –off
thanks, so, changing permissions didn‘t changed anything? did you test the script in terminal as root or user?
Yes, works perfectly
I am lost:face_with_rolling_eyes:
I tested your script, adapted a bit to my VM but it works fine… Launch command is /bin/bash /wfs/text.sh
Changed (for testing) to chmod 777 /wfs/test.sh and well… it worked🙈
Did you tried to reset your client to factory defaults and apply only this file and only the launch command to your endpoint? How many custom applications do you have?
After reset it to defaults, the only way to run it is with /bin/bash /scriptpath. I have 3 more script working right without /bin/bash🤯
Nothing really I would wonder about… Some scripts and commands are shell context related. As you are using if and elif the syntax differs between /bin/bash and /bin/sh😇
Continue reading and comment on the thread ‘How to create a custom aplication to run a script.sh?’. Not a member? Join Here!
Learn more, search the IGEL Knowledge Base
Ask a question or comment on the above message thread?
Join or log in to the IGEL Community to ask us anything and meet other IGEL customers, partners, and EUC enthusiasts.Submit a question, or Join Today!