restart.sh 472 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. # extra function
  3. ## func of log
  4. function log_warn() {
  5. local date=$(date "+%Y-%m-%d-%H:%M:%S")
  6. local para=$1
  7. echo "[WARN] $date $1"
  8. }
  9. function log_info() {
  10. local date=$(date "+%Y-%m-%d-%H:%M:%S")
  11. local para=$1
  12. echo "[INFO] $date $1"
  13. }
  14. function log_err() {
  15. local date=$(date "+%Y-%m-%d-%H:%M:%S")
  16. local para=$1
  17. echo -e "[ERROR] $date $1"
  18. }
  19. ./stop.sh no_logo "$@" && ./run.sh no_logo
  20. log_info "服务重启结束"