#!/bin/sh
# vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 :

# shellcheck disable=SC1091
. /lib/overthebox

backup_id=$(otb_json_get "$1" "arguments.backup_id")

backup="$(otb_service_get "backups/$backup_id")"

curl "$(otb_json_get "$backup" "backup_url")" | sysupgrade --restore-backup -

otb_debug "Done restoring backup $backup_id"
