mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Merge pull request #1160 from michielryvers/snapper-existing-configs
Don't hardcode snapper configs, read the config list first
This commit is contained in:
@@ -17,7 +17,11 @@ create)
|
||||
DESC="$(omarchy-version)"
|
||||
|
||||
echo -e "\e[32mCreate system snapshot\e[0m"
|
||||
for config in root home; do
|
||||
|
||||
# Get existing snapper config names from CSV output
|
||||
mapfile -t CONFIGS < <(sudo snapper --csvout list-configs | awk -F, 'NR>1 {print $1}')
|
||||
|
||||
for config in "${CONFIGS[@]}"; do
|
||||
sudo snapper -c "$config" create -c number -d "$DESC"
|
||||
done
|
||||
echo
|
||||
|
||||
10
migrations/1756153445.sh
Normal file
10
migrations/1756153445.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
echo "Checking and correcting Snapper configs if needed"
|
||||
if command -v snapper &>/dev/null; then
|
||||
if ! sudo snapper list-configs 2>/dev/null | grep -q "root"; then
|
||||
sudo snapper -c root create-config /
|
||||
fi
|
||||
|
||||
if ! sudo snapper list-configs 2>/dev/null | grep -q "home"; then
|
||||
sudo snapper -c home create-config /home
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user