windvn/path/apply-mod

22 lines
360 B
Plaintext
Raw Normal View History

2022-05-23 04:30:20 +00:00
#!/usr/bin/env bash
set -e
if [ -f "$1/data/bin/login" ]; then
if [ -f "$2/bin/login.bak" ]; then
rm "$2/bin/login"
else
mv "$2/bin/login" "$2/bin/login.bak"
fi
fi
if [ -d "$1/data" ]; then
cp -rf "$1/data/." "$2"
fi
if [ -f "$2/chroot" ]; then
fchroot "$2" "/chroot"
rm "$2/chroot"
fi
if [ -f "$1/modscript" ]; then
source "$1/modscript" "$2"
fi