thelinuxlist/scripts/wpinstall.sh

39 lines
909 B
Bash

#!/bin/bash
while true
do
read -r -p "Would you like to install Wordpress? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
echo "That wasn't an option..."
;;
esac
done
while true
do
read -p "Enter The Directory Where you want to install Wordpress: " INSTALL_DIR
if [ -d "$INSTALL_DIR" ]; then
echo "The Directory $INSTALL_DIR Already Exist"
sleep 1
else
mkdir -p $INSTALL_DIR
echo "creating $INSTALL_DIR"
break
fi
done
wget -O latest.zip https://wordpress.org/latest.zip
apt install unzip -y
unzip latest.zip -d $INSTALL_DIR
cp -r $INSTALL_DIR/wordpress/* $INSTALL_DIR
rm -rf $INSTALL_DIR/wordpress
rm -rf latest.zip
chmod -R 775 $INSTALL_DIR