Fixed leftover wrong formats
This commit is contained in:
parent
32b156de81
commit
e170f72947
|
@ -6,37 +6,37 @@ for i in "${containers[@]}"; do
|
||||||
case "$2" in
|
case "$2" in
|
||||||
"start")
|
"start")
|
||||||
if (( $(echo "${dockercont}" | grep -c "$i") > 0 )); then
|
if (( $(echo "${dockercont}" | grep -c "$i") > 0 )); then
|
||||||
output "warn Container $i was already up and running!"
|
echo "warn Container $i was already up and running!"
|
||||||
else
|
else
|
||||||
if (docker start "$i" > /dev/null 2>&1); then
|
if (docker start "$i" > /dev/null 2>&1); then
|
||||||
output "done Started container $i succesfully!"
|
echo "done Started container $i succesfully!"
|
||||||
else
|
else
|
||||||
output "erro Failed to start container $i!"
|
echo "erro Failed to start container $i!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"stop")
|
"stop")
|
||||||
if (( $(echo "${dockercont}" | grep -c "$i") > 0 )); then
|
if (( $(echo "${dockercont}" | grep -c "$i") > 0 )); then
|
||||||
if (docker stop --time=20 "$i" > /dev/null 2>&1); then
|
if (docker stop --time=20 "$i" > /dev/null 2>&1); then
|
||||||
output "done Stopped container $i succesfully!"
|
echo "done Stopped container $i succesfully!"
|
||||||
else
|
else
|
||||||
output "erro Failed to stop container $i!"
|
echo "erro Failed to stop container $i!"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
output "warn Container $i was already stopped!"
|
echo "warn Container $i was already stopped!"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"status")
|
"status")
|
||||||
if (( $(echo "${dockercont}" | grep -c "$i") > 0 )); then
|
if (( $(echo "${dockercont}" | grep -c "$i") > 0 )); then
|
||||||
output "warn Container $i is up and running!"
|
echo "warn Container $i is up and running!"
|
||||||
else
|
else
|
||||||
output "erro Container $i is stopped!"
|
echo "erro Container $i is stopped!"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
elif (systemctl -q is-active docker); then
|
elif (systemctl -q is-active docker); then
|
||||||
output "erro An error has occured, we are sorry!"
|
echo "erro An error has occured, we are sorry!"
|
||||||
else
|
else
|
||||||
output "erro Docker is stopped, cannot perform check!"
|
echo "erro Docker is stopped, cannot perform check!"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
if [ -x "$(command -v docker)" ]; then
|
if [ -x "$(command -v docker)" ]; then
|
||||||
output "info Clearing Docker remainings"
|
echo "info Clearing Docker remainings"
|
||||||
docker system prune --all -f
|
docker system prune --all -f
|
||||||
fi
|
fi
|
||||||
case $(uname -rv) in
|
case $(uname -rv) in
|
||||||
*Ubuntu*)
|
*Ubuntu*)
|
||||||
output "info Clearing & Updating APT"
|
echo "info Clearing & Updating APT"
|
||||||
apt-get -y update
|
apt-get -y update
|
||||||
apt-get -y autoclean
|
apt-get -y autoclean
|
||||||
apt-get -y autoremove
|
apt-get -y autoremove
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
output "info Clearing logs"
|
echo "info Clearing logs"
|
||||||
if [ -x "$(command -v nginx)" ]; then
|
if [ -x "$(command -v nginx)" ]; then
|
||||||
truncate -s 0 "${LOGPATH:-/var/log/nginx/*.*}"
|
truncate -s 0 "${LOGPATH:-/var/log/nginx/*.*}"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -2,14 +2,14 @@ case "$2" in
|
||||||
"update")
|
"update")
|
||||||
cd /var/www/pterodactyl || exit
|
cd /var/www/pterodactyl || exit
|
||||||
php artisan down
|
php artisan down
|
||||||
output "info Fetching latest releases"
|
echo "info Fetching latest releases"
|
||||||
curl -L https://github.com/pterodactyl/panel/releases/download/"$(getlatest "Pterodactyl/panel")"/panel.tar.gz | tar --strip-components=1 -xzv
|
curl -L https://github.com/pterodactyl/panel/releases/download/"$(getlatest "Pterodactyl/panel")"/panel.tar.gz | tar --strip-components=1 -xzv
|
||||||
curl -L https://github.com/RXCommunity/RedXen-Panel/archive/"$(getlatest "RXCommunity/RedXen-Panel")".tar.gz | tar --strip-components=1 -xzv
|
curl -L https://github.com/RXCommunity/RedXen-Panel/archive/"$(getlatest "RXCommunity/RedXen-Panel")".tar.gz | tar --strip-components=1 -xzv
|
||||||
output "info Ensuring permissions are correct"
|
echo "info Ensuring permissions are correct"
|
||||||
chown -R www-data:www-data ./*
|
chown -R www-data:www-data ./*
|
||||||
chmod -R 755 storage/* bootstrap/cache
|
chmod -R 755 storage/* bootstrap/cache
|
||||||
output "info Getting latest deps"
|
echo "info Getting latest deps"
|
||||||
composer install --no-dev --optimize-autoloader || output "erro Failed to get deps!"
|
composer install --no-dev --optimize-autoloader || echo "erro Failed to get deps!"
|
||||||
|
|
||||||
artisanfunc=(
|
artisanfunc=(
|
||||||
"view:clear"
|
"view:clear"
|
||||||
|
@ -21,10 +21,10 @@ case "$2" in
|
||||||
"up"
|
"up"
|
||||||
)
|
)
|
||||||
|
|
||||||
output "info Running migrations and clearance"
|
echo "info Running migrations and clearance"
|
||||||
for f in "${artisanfunc[@]}"; do
|
for f in "${artisanfunc[@]}"; do
|
||||||
php artisan $f || output "erro Failed to execute 'artisan ${f}'"
|
php artisan $f || echo "erro Failed to execute 'artisan ${f}'"
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
*); echo "Nothing to do";;
|
*); echo "warn Nothing to do";;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
for i in ${#DIRS[@]}; do
|
||||||
|
echo "info" "Syncing ${DIRS[$I]##*${DELIMIT}} with ${DIRS[$I]%%${DELIMIT}*}"
|
||||||
|
(rclone sync -P ${DIRS[$I]%%${DELIMIT}*} ${DIRS[$I]##*${DELIMIT}}) > /dev/null 2>&1
|
||||||
|
done
|
Reference in New Issue