diff --git a/Install.sh b/Install.sh index 69f7ea1..de8219d 100755 --- a/Install.sh +++ b/Install.sh @@ -4,8 +4,10 @@ cd "$( dirname "$( realpath "$0" )" )" CopyCfg() { for Type in "" "." do - [ "$(whoami)" = "root" ] && [ -d "$1/Root" ] && cp -r $(find "$1/Root" -maxdepth 1 -mindepth 1 -name "$Type*") / - [ -d "$1/Home" ] && cp -r $(find "$1/Home" -maxdepth 1 -mindepth 1 -name "$Type*") ~/ + [ "$(whoami)" = "root" ] && [ -d "$1/Root" ] && \ + cp -r $(find "$1/Root" -maxdepth 1 -mindepth 1 -name "$Type*") / + [ -d "$1/Home" ] && \ + cp -r $(find "$1/Home" -maxdepth 1 -mindepth 1 -name "$Type*") ~/ done } diff --git a/README.md b/README.md new file mode 100644 index 0000000..3ed874b --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +This is the repo with all my system configurations. It's public just for my comfort, not for public use, but you are free anyways to use everything you want as you need. Just don't blindly install everything on your system without knowing the implications. + +Install oneliner (run as root to install system components) (as I just said, don't use): + +
 Url="https://gitlab.com/octospacc/Configs/-/raw/main/RemoteInstall.sh";  if [ -n "$(which curl)" ];  then curl "$Url" | sh;  elif [ -n "$(which wget)" ];  then wget -O - "$Url" | sh;  else echo "Missing tools. Install \`curl\` or \`wget\`.";  fi
+
diff --git a/RemoteInstall.sh b/RemoteInstall.sh new file mode 100644 index 0000000..4d5bfa9 --- /dev/null +++ b/RemoteInstall.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +[ -z "$(which git)" ] \ + && echo "Missing tools. Install \`git\`." \ + && exit 1 + +[ "$(whoami)" = "root" ] \ + && echo "Running as root; copying system files." + +[ "$(whoami)" != "root" ] \ + && echo "Running as user; only copying home files." + +true \ +&& git clone --depth 1 "https://gitlab.com/octospacc/Configs" \ +&& cd ./Configs \ +&& echo "Which install target?" \ +&& echo "(Available: $(ls -d */))" \ +&& read Target \ +&& sh ./Install.sh "$Target"