Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -ue
- #Invoice Ninja Self-Hosted Update
- #USE AT YOUR OWN RISK
- #Replace <user> and </path/to/ninja> with your specifics, obviously.
- tempdir="/home/<user>/download/InvoiceNinja"
- ninjahome="</path/to/ninja>"
- ninjatemp="$tempdir/ninja"
- ninjastore="$ninjahome/storage"
- read -ep 'Enter Version Number (ex. "3.3.3"): ' ninjaver
- ninjafile="ninja-v$ninjaver.zip"
- ninjaurl="https://download.invoiceninja.com/$ninjafile"
- ninjazip="$tempdir/$ninjafile"
- wget -P "$tempdir/" "$ninjaurl"
- unzip "$ninjazip" -d "$tempdir/"
- sudo rsync -vtr "$ninjatemp/" "$ninjahome/"
- printf '\nResetting permissions for "%s" ...\n\n' "$ninjastore"
- sudo chown -R www-data:www-data "$ninjastore/"
- sudo chmod -R 775 "$ninjastore/"
- printf 'Removing downloaded ZIP file "%s" ...\n\nRemoving temporary folder "%s" ...\n\n' "$ninjazip" "$tempdir"
- rm -rf "$tempdir/"
- printf 'Invoice Ninja successfully updated to v%s!\n\n' "$ninjaver"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement