PhyrePanel-mirror/web/update.sh

67 lines
2.8 KiB
Bash
Raw Normal View History

2024-09-16 10:31:48 +00:00
PHYRE_PHP=/usr/local/phyre/php/bin/php
2024-10-01 09:08:55 +00:00
rm -rf /usr/local/phyre/update/web
mkdir -p /usr/local/phyre/update/web
rm -rf /usr/local/phyre/update/phyre-web-panel.zip
wget https://github.com/PhyreApps/PhyrePanelWebCompiledVersions/raw/refs/heads/main/phyre-web-panel.zip -O /usr/local/phyre/update/phyre-web-panel.zip
unzip /usr/local/phyre/update/phyre-web-panel.zip -d /usr/local/phyre/update/web
rm -rf /usr/local/phyre/web/app
2024-10-01 09:15:54 +00:00
rm -rf /usr/local/phyre/web/Modules
2024-10-01 09:08:55 +00:00
rm -rf /usr/local/phyre/web/bootstrap
rm -rf /usr/local/phyre/web/config
rm -rf /usr/local/phyre/web/database
rm -rf /usr/local/phyre/web/public
rm -rf /usr/local/phyre/web/resources
rm -rf /usr/local/phyre/web/routes
rm -rf /usr/local/phyre/web/tests
rm -rf /usr/local/phyre/web/vendor
rm -rf /usr/local/phyre/web/composer.json
rm -rf /usr/local/phyre/web/composer.lock
rm -rf /usr/local/phyre/web/package.json
cp -r /usr/local/phyre/update/web/app /usr/local/phyre/web/app
2024-10-01 09:15:54 +00:00
cp -r /usr/local/phyre/update/web/Modules /usr/local/phyre/web/Modules
2024-10-01 09:08:55 +00:00
cp -r /usr/local/phyre/update/web/bootstrap /usr/local/phyre/web/bootstrap
cp -r /usr/local/phyre/update/web/config /usr/local/phyre/web/config
cp -r /usr/local/phyre/update/web/database /usr/local/phyre/web/database
cp -r /usr/local/phyre/update/web/public /usr/local/phyre/web/public
cp -r /usr/local/phyre/update/web/resources /usr/local/phyre/web/resources
cp -r /usr/local/phyre/update/web/routes /usr/local/phyre/web/routes
cp -r /usr/local/phyre/update/web/tests /usr/local/phyre/web/tests
cp -r /usr/local/phyre/update/web/vendor /usr/local/phyre/web/vendor
cp /usr/local/phyre/update/web/composer.json /usr/local/phyre/web/composer.json
cp /usr/local/phyre/update/web/composer.lock /usr/local/phyre/web/composer.lock
cp /usr/local/phyre/update/web/package.json /usr/local/phyre/web/package.json
2024-09-16 10:40:26 +00:00
systemctl stop phyre
apt-remove phyre -y
2024-09-16 10:31:48 +00:00
2024-09-16 10:40:26 +00:00
OS=$(lsb_release -si)
OS_LOWER=$(echo $OS | tr '[:upper:]' '[:lower:]')
OS_VERSION=$(lsb_release -sr)
2024-09-16 10:31:48 +00:00
2024-09-16 10:40:26 +00:00
rm -rf /usr/local/phyre/update/nginx
mkdir -p /usr/local/phyre/update/nginx
wget https://github.com/PhyreApps/PhyrePanelNGINX/raw/main/compilators/debian/nginx/dist/phyre-nginx-1.24.0-$OS_LOWER-$OS_VERSION.deb -O /usr/local/phyre/update/nginx/phyre-nginx-1.24.0-$OS_LOWER-$OS_VERSION.deb
dpkg -i /usr/local/phyre/update/nginx/phyre-nginx-1.24.0-$OS_LOWER-$OS_VERSION.deb
#
2024-09-16 10:35:33 +00:00
printf "Updating the panel...\n"
wget https://raw.githubusercontent.com/PhyreApps/PhyrePanelNGINX/main/compilators/debian/nginx/nginx.conf -O /usr/local/phyre/nginx/conf/nginx.conf
2024-09-16 10:40:26 +00:00
#
2024-09-16 10:35:33 +00:00
mkdir -p /usr/local/phyre/ssl
cp /usr/local/phyre/web/server/ssl/phyre.crt /usr/local/phyre/ssl/phyre.crt
cp /usr/local/phyre/web/server/ssl/phyre.key /usr/local/phyre/ssl/phyre.key
systemctl restart phyre
2024-09-16 10:40:26 +00:00
#systemctl status phyre
2024-09-16 10:31:48 +00:00
printf "Updating the database...\n"
2024-09-24 13:06:38 +00:00
$PHYRE_PHP /usr/local/phyre/web/artisan migrate
2024-09-16 10:31:48 +00:00
#$PHYRE_PHP artisan l5-swagger:generate