I wrote this small script to help me reduce the hassle involved in starting and stopping the lampp server on my local machine:
#!/bin/sh
#script to make lampp start/stop easier
if [ $1 == "start" ] ; then
sudo /opt/lampp/lampp start &
elif [ $1 == "stop" ] ; then
sudo /opt/lampp/lampp stop
else
echo 'Wrong parameter.'
fi
I'd now like to go a step ahead and hardcode the superuser password into it so that I don't have to type it every time. I tried something like echo 'XXXX' | sudo /opt/lampp/lampp start & but got the three-unsuccessful-attempts error.
How can this be done?
sudo myscript.sh./opt/lampp/lamppto/etc/sudoers, notmyscript.sh.