mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Improve snapshot existence test ?
This commit is contained in:
parent
88cf83cd8e
commit
1f17234e9b
1 changed files with 5 additions and 1 deletions
|
@ -14,7 +14,11 @@ LXC_CREATE () {
|
|||
}
|
||||
|
||||
LXC_SNAPSHOT_EXISTS() {
|
||||
sudo lxc info $LXC_NAME 2>/dev/null | grep -A10 Snapshots | tail -n -1 | awk '{print $1}' | grep -q -w "$1"
|
||||
local snapname=$1
|
||||
sudo lxc list --format json \
|
||||
| jq -e --arg LXC_NAME $LXC_NAME --arg snapname $snapname \
|
||||
'.[] | select(.name==$LXC_NAME) | .snapshots[] | select(.name==$snapname)' \
|
||||
>/dev/null
|
||||
}
|
||||
|
||||
CREATE_LXC_SNAPSHOT () {
|
||||
|
|
Loading…
Add table
Reference in a new issue