feat: add maintenance mode toggle functionality in runner script to enhance Laravel application management
This commit is contained in:
30
runner.sh
30
runner.sh
@@ -21,9 +21,11 @@ $divider
|
|||||||
[2] Run gitpush.sh
|
[2] Run gitpush.sh
|
||||||
[3] Run laravallog.sh
|
[3] Run laravallog.sh
|
||||||
[4] Run laravalcache.sh
|
[4] Run laravalcache.sh
|
||||||
[5] Clear Laravel log
|
[5] Maintenance mode ON
|
||||||
[6] Clear Laravel log and show logs
|
[6] Maintenance mode OFF
|
||||||
[7] Exit
|
[7] Clear Laravel log
|
||||||
|
[8] Clear Laravel log and show logs
|
||||||
|
[9] Exit
|
||||||
$divider
|
$divider
|
||||||
Select an option by pressing the number key.
|
Select an option by pressing the number key.
|
||||||
EOF
|
EOF
|
||||||
@@ -49,6 +51,24 @@ EOF
|
|||||||
"$git_cache"
|
"$git_cache"
|
||||||
;;
|
;;
|
||||||
5)
|
5)
|
||||||
|
echo "Enabling maintenance mode..."
|
||||||
|
cd "$SCRIPT_DIR" && php artisan down
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Maintenance mode is now ON"
|
||||||
|
else
|
||||||
|
echo "Failed to enable maintenance mode"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
6)
|
||||||
|
echo "Disabling maintenance mode..."
|
||||||
|
cd "$SCRIPT_DIR" && php artisan up
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "Maintenance mode is now OFF"
|
||||||
|
else
|
||||||
|
echo "Failed to disable maintenance mode"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
7)
|
||||||
LOG_DATE=$(date +%Y-%m-%d)
|
LOG_DATE=$(date +%Y-%m-%d)
|
||||||
LOG_FILE="${SCRIPT_DIR}/storage/logs/laravel-${LOG_DATE}.log"
|
LOG_FILE="${SCRIPT_DIR}/storage/logs/laravel-${LOG_DATE}.log"
|
||||||
if [ -f "$LOG_FILE" ]; then
|
if [ -f "$LOG_FILE" ]; then
|
||||||
@@ -58,7 +78,7 @@ EOF
|
|||||||
echo "Log file not found: $LOG_FILE"
|
echo "Log file not found: $LOG_FILE"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
6)
|
8)
|
||||||
# Clear Laravel log first
|
# Clear Laravel log first
|
||||||
LOG_DATE=$(date +%Y-%m-%d)
|
LOG_DATE=$(date +%Y-%m-%d)
|
||||||
LOG_FILE="${SCRIPT_DIR}/storage/logs/laravel-${LOG_DATE}.log"
|
LOG_FILE="${SCRIPT_DIR}/storage/logs/laravel-${LOG_DATE}.log"
|
||||||
@@ -79,7 +99,7 @@ EOF
|
|||||||
[ -x "$git_log" ] || chmod +x "$git_log"
|
[ -x "$git_log" ] || chmod +x "$git_log"
|
||||||
"$git_log"
|
"$git_log"
|
||||||
;;
|
;;
|
||||||
7)
|
9)
|
||||||
echo "Goodbye!"
|
echo "Goodbye!"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user