vito/resources/views/ssh/wordpress/install.blade.php
Saeed Vaziry cdbde063f0
use blade as conmmands template (#444)
* use blade as conmmands template

* fix lint

* fix ssl
2025-01-27 21:27:58 +01:00

41 lines
1.1 KiB
PHP

if ! curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! chmod +x wp-cli.phar; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if [ "{{ $isIsolated }}" == "true" ]; then
mv wp-cli.phar /home/{{ $isolatedUsername }}/bin/
ln -s /home/{{ $isolatedUsername }}/bin/wp-cli.phar /home/{{ $isolatedUsername }}/bin/wp
else
if ! sudo mv wp-cli.phar /usr/local/bin/wp; then
echo 'VITO_SSH_ERROR' && exit 1
fi
fi
rm -rf {{ $path }}
if ! wp --path={{ $path }} core download; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! wp --path={{ $path }} core config \
--dbname="{{ $dbName }}" \
--dbuser="{{ $dbUser }}" \
--dbpass="{{ $dbPass }}" \
--dbhost="{{ $dbHost }}" \
--dbprefix="{{ $dbPrefix }}"; then
echo 'VITO_SSH_ERROR' && exit 1
fi
if ! wp --path={{ $path }} core install \
--url="http://{{ $domain }}" \
--title="{{ $title }}" \
--admin_user="{{ $username }}" \
--admin_password="{{ $password }}" \
--admin_email="{{ $email }}"; then
echo 'VITO_SSH_ERROR' && exit 1
fi