#!/bin/sh

addgroup -S incus 2>/dev/null
addgroup -S incus-user 2>/dev/null

for file in /etc/subuid /etc/subgid; do
	if ! $(grep -q root "$file"); then
		echo "root:1000000:1000000000" >> "$file"
	else
		sed -i 's/^root.*/root:1000000:1000000000/' "$file"
	fi
done

exit 0
