Files
gaming-image-files/root/live-update.sh
2025-07-14 08:46:48 -04:00

17 lines
567 B
Bash

#!/usr/bin/env bash
gitUrl="https://git.stormux.org/storm/gaming-image-files"
gitPath="${gitUrl##*/}"
pushd /tmp
sudo -u stormux git clone "${gitUrl}"
pushd "${gitPath}"
# Handle home directory files (preserve user ownership)
find . -path './.git' -prune -o -path './home/stormux/*' -type f -exec bash -c 'for i ; do cp -av "${i}" "/${i#./}";done' _ {} \;
# Handle system files (will be root-owned)
find . -path './.git' -prune -o -path './home' -prune -o -type f -exec bash -c 'for i ; do cp -v "${i}" "/${i#./}";done' _ {} \;
popd
rm -rf "${gitPath}"
popd
exit 0