install_clamav.sh 1001 B

12345678910111213141516171819
  1. #!/bin/bash
  2. function error {
  3. echo -e "\\e[91m$1\\e[39m"
  4. exit 1
  5. }
  6. echo "Creating directories..."
  7. sudo mkdir -p /portainer/Files/AppData/Config/clamav/config || error "Failed to create clamav config folder!"
  8. sudo mkdir -p /portainer/Files/AppData/Config/clamav/virus_definitions || error "Failed to create clamav virus_definitions folder!"
  9. echo "Creating pre-filled clamav config files"
  10. sudo wget -O /portainer/Files/AppData/Config/clamav/config/clamd.conf https://github.com/Cisco-Talos/clamav/files/10096744/clamd.conf.txt || error "Failed to get clamd config file!"
  11. sudo wget -O /portainer/Files/AppData/Config/clamav/config/freshclam.conf https://github.com/Cisco-Talos/clamav/files/10096745/freshclam.conf.txt || error "Failed to get freshclam config file"
  12. echo "Setting the right permissions"
  13. sudo chown -R 100:101 /portainer/Files/AppData/Config/clamav/ || error "Unable to set the right permissions for clamav!"
  14. echo "Setup complete. You can now install clamav using the App Template."