install_vikunja.sh 916 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. function error {
  3. echo -e "\\e[91m$1\\e[39m"
  4. exit 1
  5. }
  6. function check_internet() {
  7. printf "Checking if you are online..."
  8. wget -q --spider http://github.com
  9. if [ $? -eq 0 ]; then
  10. echo "Online. Continuing."
  11. else
  12. error "Offline. Go connect to the internet then run the script again."
  13. fi
  14. }
  15. check_internet
  16. echo "Creating directories..."
  17. sudo mkdir -p /portainer/Files/AppData/Config/Vikunja || error "Failed to create Vikunja directory!"
  18. echo "Downloading vikunja config files"
  19. sudo wget -O /portainer/Files/AppData/Config/Vikunja/nginx.conf https://raw.githubusercontent.com/pi-hosted/pi-hosted/master/configs/vikunja_nginx.conf || error "Failed to download nginx.conf file!"
  20. echo "Setting permissions..."
  21. sudo chown -R 1000.1000 /portainer/Files/AppData/Config/Vikunja || error "Failed to set permissions for modules data!"
  22. echo "Done You are ready to install the Vikunja Template"