mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-03 11:09:27 +00:00
41 lines
1.1 KiB
Bash
41 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
#检查系统
|
|
check_sys() {
|
|
# shellcheck disable=SC2002
|
|
if [[ -f /etc/redhat-release ]]; then
|
|
release="centos"
|
|
elif cat /etc/issue | grep -q -E -i "debian"; then
|
|
release="debian"
|
|
elif cat /etc/issue | grep -q -E -i "ubuntu"; then
|
|
release="ubuntu"
|
|
elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
|
|
release="centos"
|
|
elif cat /proc/version | grep -q -E -i "debian"; then
|
|
release="debian"
|
|
elif cat /proc/version | grep -q -E -i "ubuntu"; then
|
|
release="ubuntu"
|
|
elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
|
|
release="centos"
|
|
fi
|
|
}
|
|
#检查composer是否安装
|
|
check_composer() {
|
|
if [ ! -f "/usr/bin/composer" ]; then
|
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
|
|
fi
|
|
}
|
|
|
|
# 设置权限
|
|
set_permissions() {
|
|
chown -R www:www ./
|
|
chmod -R 755 ./
|
|
chmod -R 777 storage/
|
|
}
|
|
|
|
git fetch --all && git reset --hard origin/master && git pull
|
|
check_sys
|
|
check_composer
|
|
php artisan optimize:clear
|
|
composer update
|
|
php artisan panel:update
|
|
set_permissions |