Make /opt/moonarch root-owned for multi-user support

Remove chown from archinstall custom-commands so the repo stays
root:root. Use sudo for git operations in update.sh. Any user with
sudo can now run moonarch-update without owning the repo.
This commit is contained in:
2026-03-29 15:23:39 +02:00
parent 6ca8931f04
commit 1679fcfb30
5 changed files with 21 additions and 10 deletions
+6 -6
View File
@@ -15,17 +15,17 @@ check_not_root
log "=== Update Moonarch repo ==="
cd "$PROJECT_DIR"
if git rev-parse --is-inside-work-tree &>/dev/null; then
LOCAL=$(git rev-parse HEAD)
git fetch origin
REMOTE=$(git rev-parse @{u} 2>/dev/null || echo "$LOCAL")
if sudo git rev-parse --is-inside-work-tree &>/dev/null; then
LOCAL=$(sudo git rev-parse HEAD)
sudo git fetch origin
REMOTE=$(sudo git rev-parse @{u} 2>/dev/null || echo "$LOCAL")
if [[ "$LOCAL" != "$REMOTE" ]]; then
log "Updates available."
git --no-pager log --oneline "$LOCAL".."$REMOTE"
sudo git --no-pager log --oneline "$LOCAL".."$REMOTE"
echo ""
if confirm "Update repo?"; then
git pull --ff-only
sudo git pull --ff-only
log "Repo updated."
else
log "Repo update skipped."