Created update script for ledger-cli using simplefin
This commit is contained in:
17
ledger/update.sh
Normal file
17
ledger/update.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ $# < 1 ]]; then
|
||||
echo "Usage: $0 <start-date>"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -f "~/.simplefin.enc" ]]; then
|
||||
echo "Simplefin access URL is missing."
|
||||
echo "Please run the setup script before running update."
|
||||
exit
|
||||
fi
|
||||
|
||||
SCRIPT_DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||
ACCESS_URL="$(cat ~/.simplefin.enc | openssl aes-256-cbc -d -a -salt -pbkdf2 -iter 1000000)"
|
||||
|
||||
curl -L "${ACCESS_URL}/accounts?start-date=$(date -d "$1" '+%s')&pending=1" | jq -r -f "${SCRIPT_DIR}/update.jq"
|
||||
Reference in New Issue
Block a user