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