Wrote a very simple script to manually start apache and mysql when i really need it.
What script is doing is starting apache and mysql and pops a message that everything has been started.
Code:
#!/bin/bash
sudo service apache2 start
sudo service mysql start
zenity --info --text 'Apache and MySQL has been started sucessfully!'
start can be changed on stop or restart, depends on why you need this scirpt forPlease note that in order for this to run correctly with no password you have to modify /etc/sudoers
The part that you need looks like this.
Code:
# Cmnd alias specification
Cmnd_Alias HTTPD = /etc/init.d/apache2, /var/init.d/mysql
# User privilege specification
root ALL=(ALL) ALL
screatch ALL=NOPASSWD: HTTPD
* Change screatch on your usernameAlso please note that this is my first ever script so i will be glad to hear any complaints and advices.