I have a pig.sh file located in /home/pi/.config/lxsession/LXDE-pi :
Code: Select all
#!/bin/sh
cd /home/pi/Desktop/lgpt/lgpt_DEB/bin
exec ./lgpt.rpi-exe
sudo shutdown -h now
sudo poweroff
sudo halt
pig.sh is started with autostart file in same folder which is like this :
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@point-rpi
@sh /home/pi/.config/lxsession/LXDE-pi/pig.sh
I tried also inserting the shuting down command at the end of auto start file. If I do that, it works but it shut down just after pig.sh is started. It is supposed to do it only when I quit the program, not at startup.