mirror of
https://gitlab.com/octospacc/Configs.git
synced 2025-02-08 23:48:44 +01:00
25 lines
515 B
Bash
25 lines
515 B
Bash
|
#!/bin/sh
|
||
|
cd "$( dirname "$( realpath "$0" )" )"
|
||
|
|
||
|
CopyCfg() {
|
||
|
for Type in "" "."
|
||
|
do
|
||
|
#[ "$(whoami)" = "root" ] && cp -r $1/Root/$Type* /
|
||
|
#cp -r $1/Home/$Type* ~/
|
||
|
[ "$(whoami)" = "root" ] && [ -d "$1/Root" ] && cp $(find "$1/Root" -maxdepth 1 -mindepth 1 -name "$Type*") /
|
||
|
[ -d "$1/Home" ] && cp $(find "$1/Home" -maxdepth 1 -mindepth 1 -name "$Type*") ~/
|
||
|
done
|
||
|
}
|
||
|
|
||
|
Cur="$1"
|
||
|
while [ ! -z "$Cur" ]
|
||
|
do
|
||
|
if [ -d "$Cur" ]
|
||
|
then
|
||
|
echo "$Cur"
|
||
|
CopyCfg "$Cur"
|
||
|
fi
|
||
|
shift > /dev/null 2>&1 || Cur=""
|
||
|
Cur="$1"
|
||
|
done
|