LAMP一键安装脚本
#!/bin/sh
echo 'LAMP Setup'
echo '1.Setup'
echo '2.Remove'
echo '3.Quit'
read a
if [ $a -eq 1 ]; then
echo "----------------------------------------------------"
echo "Setup"
echo "----------------------------------------------------"
echo "Apt-get update"
echo "----------------------------------------------------"
echo "Do you want to continue?"
echo "1.yes"
echo "2.no"
read b
if [ $b -eq 1 ];then
apt-get update
fi
echo "----------------------------------------------------"
echo "Apache2 Setup"
echo "----------------------------------------------------"
sudo apt-get -y install apache2
echo "----------------------------------------------------"
echo "PHP5 Setup"
echo "----------------------------------------------------"
sudo apt-get -y install php5
echo "----------------------------------------------------"
echo "MySQL Setup"
echo "----------------------------------------------------"
sudo apt-get -y install mysql-server
sudo apt-get -y install php5-mysql
echo "----------------------------------------------------"
echo "Apache2 Restart"
echo "----------------------------------------------------"
sudo service apache2 restart
echo "Apache2 Restart OK!"
echo "----------------------------------------------------"
echo "OK!"
echo "----------------------------------------------------"
elif [ $a -eq 2 ];then
echo "----------------------------------------------------"
echo "Remove"
echo "----------------------------------------------------"
echo "Apache2 Remove"
echo "----------------------------------------------------"
apt-get autoremove --purge -y apache2
echo "----------------------------------------------------"
echo "PHP Remove"
echo "----------------------------------------------------"
apt-get autoremove --purge -y php5
echo "----------------------------------------------------"
echo "MySQL Remove"
echo "----------------------------------------------------"
apt-get autoremove --purge -y mysql-server
apt-get autoremove --purge -y php-mysql
echo "----------------------------------------------------"
echo "OK!"
echo "----------------------------------------------------"
else
echo "-----Quit-----"
fi
#Powered by <?php echo"test-2"?>