changedetection-install.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. $STD apt-get install -y pip
  18. msg_ok "Installed Dependencies"
  19. msg_info "Installing Change Detection"
  20. mkdir /opt/changedetection
  21. $STD pip3 install changedetection.io
  22. $STD python3 -m pip install dnspython==2.2.1
  23. msg_ok "Installed Change Detection"
  24. msg_info "Creating Service"
  25. cat <<EOF >/etc/systemd/system/changedetection.service
  26. [Unit]
  27. Description=Change Detection
  28. After=network-online.target
  29. [Service]
  30. Type=simple
  31. WorkingDirectory=/opt/changedetection
  32. Environment="WEBDRIVER_URL=http://127.0.0.1:4444/wd/hub"
  33. ExecStart=changedetection.io -d /opt/changedetection -p 5000
  34. [Install]
  35. WantedBy=multi-user.target
  36. EOF
  37. $STD systemctl enable --now changedetection
  38. msg_ok "Created Service"
  39. motd_ssh
  40. root
  41. msg_info "Cleaning up"
  42. $STD apt-get autoremove
  43. $STD apt-get autoclean
  44. msg_ok "Cleaned"