modified: install/fedora.sh
deleted: install/j.sh modified: install/tree_cpy.sh new file: usr/bin/search-google modified: usr/home/.bashrc modified: usr/sbin/brc
This commit is contained in:
+24
-3
@@ -6,8 +6,29 @@ USR_DIR=${1:-"no_dir"}
|
||||
exit 1
|
||||
USR_DIR=$(realpath $USR_DIR)
|
||||
|
||||
#uses ssymbolic link otherwise crossdevice troubles
|
||||
cp -s -p -r -f -t / $USR_DIR/*/.[^.]*
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
src="${1:-/svr/usr}"
|
||||
dst="${2:-/}"
|
||||
|
||||
src="$(readlink -f "$src")"
|
||||
|
||||
find "$src" -type f | while IFS= read -r f; do
|
||||
rel="${f#$src/}"
|
||||
target="$dst/$rel"
|
||||
|
||||
# ensure parent dir exists (but never replace dirs)
|
||||
mkdir -p "$(dirname "$target")"
|
||||
|
||||
# if target exists and is a directory → skip
|
||||
if [ -d "$target" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# replace file or create new symlink
|
||||
ln -sf "$f" "$target"
|
||||
done
|
||||
|
||||
useradd svr
|
||||
chown root:svr /etc /var /run /dev /usr /sys / /svr
|
||||
chown -R root:svr /svr
|
||||
|
||||
Reference in New Issue
Block a user