22 lines
360 B
Bash
Executable File
22 lines
360 B
Bash
Executable File
#!/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 |