changedetection-install.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. ExecStart=changedetection.io -d /opt/changedetection -p 5000
  33. [Install]
  34. WantedBy=multi-user.target
  35. EOF
  36. $STD systemctl enable --now changedetection
  37. msg_ok "Created Service"
  38. motd_ssh
  39. root
  40. msg_info "Cleaning up"
  41. $STD apt-get autoremove
  42. $STD apt-get autoclean
  43. msg_ok "Cleaned"