Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.01 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Internal API or Events
  4. # Docs: https://malaya.com/en/api/internal-api-events/
  5.  
  6. # Description: Execute actions at certain points or events, for example at the end of the "stack" command each time is executed
  7. # or after Nginx is installed. Just rename this file to "api-events" and check for the complete list of status codes in the documentation.
  8.  
  9. # Just put all your code inside this function:
  10. api-events_catch_status() {
  11.     echo "${blu}API Status: $1 ${end}"
  12.  
  13.   # webinoly -init
  14.   if [[ -n $init ]]; then
  15.     echo "Updating system..."
  16.     sudo apt-get upgrade && sudo apt-get upgrade -y
  17.  
  18.   # site domain.com -badbots
  19.   elif [[ -n $badbots ]]; then
  20.     echo "Installing nginx badbots..."
  21.     # Do various checkups and execute commands from:
  22.     # https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker
  23.  
  24.   # webinoly -fail2ban
  25.   elif [[ -n $fail2ban ]]; then
  26.     echo "Installing fail2ban"
  27.     apt install -y -qq fail2ban
  28.     # Execute other configuration steps
  29.   fi
  30.   exit 0
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement