Add 'scripts/wpinstall.sh'

This commit is contained in:
Sophia Atkinson 2022-10-28 22:45:20 -07:00
parent 63d7dd3845
commit 8f82bb22bd
1 changed files with 38 additions and 0 deletions

38
scripts/wpinstall.sh Normal file
View File

@ -0,0 +1,38 @@
#!/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