From 33c20614d9f726e6a69cd4861c5c81b771a698c2 Mon Sep 17 00:00:00 2001 From: octospacc Date: Mon, 6 Mar 2023 09:40:49 +0100 Subject: [PATCH] New install scripts, consistent folder structure --- {Misc => Desktop/Home}/.config/i3/config | 0 .../Home}/.config/i3status/config | 0 Install.sh | 24 +++++++++++++++++++ Makefile | 0 Misc/{ => Home}/.bashrc.part | 0 Misc/{ => Home}/.config/micro/settings.json | 0 Misc/{ => Home}/.dotfiles/aliasrc | 0 Misc/{ => Home}/.dotfiles/exportrc | 0 Misc/{ => Home}/.dotfiles/functrc | 0 Misc/{ => Home}/.tmux.conf | 0 Server/.Repo.Update.sh | 8 ------- Server/Repo.Update.sh | 9 +++++++ .../Server}/Scripts/Backup/BackupGlobals.cfg | 0 .../Server}/Scripts/Backup/CloudBackup.sh | 0 .../Scripts/Backup/ExternalDataBackup.sh | 0 .../Scripts/Backup/ServerDataBackup.sh | 0 Server/{ => Root/etc}/diycron | 0 .../etc}/nginx/sites-available/articles | 0 .../sites-available/epic.octt.eu.org.conf | 0 .../etc}/nginx/sites-available/feeds | 0 .../sites-available/godo.octt.eu.org.conf | 0 .../etc}/nginx/sites-available/librex | 0 .../sites-available/miss.octt.eu.org.conf | 0 .../{ => Root/etc}/nginx/sites-available/root | 0 Tests/Home/.Configs.Test | 1 + Tests/Root/.Configs.Test | 1 + 26 files changed, 35 insertions(+), 8 deletions(-) rename {Misc => Desktop/Home}/.config/i3/config (100%) rename {Misc => Desktop/Home}/.config/i3status/config (100%) create mode 100755 Install.sh delete mode 100644 Makefile rename Misc/{ => Home}/.bashrc.part (100%) rename Misc/{ => Home}/.config/micro/settings.json (100%) rename Misc/{ => Home}/.dotfiles/aliasrc (100%) rename Misc/{ => Home}/.dotfiles/exportrc (100%) rename Misc/{ => Home}/.dotfiles/functrc (100%) rename Misc/{ => Home}/.tmux.conf (100%) delete mode 100755 Server/.Repo.Update.sh create mode 100755 Server/Repo.Update.sh rename Server/{ => Root/Server}/Scripts/Backup/BackupGlobals.cfg (100%) rename Server/{ => Root/Server}/Scripts/Backup/CloudBackup.sh (100%) rename Server/{ => Root/Server}/Scripts/Backup/ExternalDataBackup.sh (100%) rename Server/{ => Root/Server}/Scripts/Backup/ServerDataBackup.sh (100%) rename Server/{ => Root/etc}/diycron (100%) rename Server/{ => Root/etc}/nginx/sites-available/articles (100%) rename Server/{ => Root/etc}/nginx/sites-available/epic.octt.eu.org.conf (100%) rename Server/{ => Root/etc}/nginx/sites-available/feeds (100%) rename Server/{ => Root/etc}/nginx/sites-available/godo.octt.eu.org.conf (100%) rename Server/{ => Root/etc}/nginx/sites-available/librex (100%) rename Server/{ => Root/etc}/nginx/sites-available/miss.octt.eu.org.conf (100%) rename Server/{ => Root/etc}/nginx/sites-available/root (100%) create mode 100644 Tests/Home/.Configs.Test create mode 100644 Tests/Root/.Configs.Test diff --git a/Misc/.config/i3/config b/Desktop/Home/.config/i3/config similarity index 100% rename from Misc/.config/i3/config rename to Desktop/Home/.config/i3/config diff --git a/Misc/.config/i3status/config b/Desktop/Home/.config/i3status/config similarity index 100% rename from Misc/.config/i3status/config rename to Desktop/Home/.config/i3status/config diff --git a/Install.sh b/Install.sh new file mode 100755 index 0000000..c093c43 --- /dev/null +++ b/Install.sh @@ -0,0 +1,24 @@ +#!/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 diff --git a/Makefile b/Makefile deleted file mode 100644 index e69de29..0000000 diff --git a/Misc/.bashrc.part b/Misc/Home/.bashrc.part similarity index 100% rename from Misc/.bashrc.part rename to Misc/Home/.bashrc.part diff --git a/Misc/.config/micro/settings.json b/Misc/Home/.config/micro/settings.json similarity index 100% rename from Misc/.config/micro/settings.json rename to Misc/Home/.config/micro/settings.json diff --git a/Misc/.dotfiles/aliasrc b/Misc/Home/.dotfiles/aliasrc similarity index 100% rename from Misc/.dotfiles/aliasrc rename to Misc/Home/.dotfiles/aliasrc diff --git a/Misc/.dotfiles/exportrc b/Misc/Home/.dotfiles/exportrc similarity index 100% rename from Misc/.dotfiles/exportrc rename to Misc/Home/.dotfiles/exportrc diff --git a/Misc/.dotfiles/functrc b/Misc/Home/.dotfiles/functrc similarity index 100% rename from Misc/.dotfiles/functrc rename to Misc/Home/.dotfiles/functrc diff --git a/Misc/.tmux.conf b/Misc/Home/.tmux.conf similarity index 100% rename from Misc/.tmux.conf rename to Misc/Home/.tmux.conf diff --git a/Server/.Repo.Update.sh b/Server/.Repo.Update.sh deleted file mode 100755 index f0a351e..0000000 --- a/Server/.Repo.Update.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -cd "$( dirname "$( realpath "$0" )" )" - -cp -v /etc/diycron ./diycron -cp -v /Server/Scripts/Backup/*.sh ./Scripts/Backup/ -cp -v /Server/Scripts/Backup/*.cfg ./Scripts/Backup/ -# nginx was done manually diff --git a/Server/Repo.Update.sh b/Server/Repo.Update.sh new file mode 100755 index 0000000..60028a6 --- /dev/null +++ b/Server/Repo.Update.sh @@ -0,0 +1,9 @@ +#!/bin/sh +cd "$( dirname "$( realpath "$0" )" )" +cd ./Root + +cp -v /etc/diycron ./etc/diycron +# nginx was done manually + +cp -v /Server/Scripts/Backup/*.sh ./Server/Scripts/Backup/ +cp -v /Server/Scripts/Backup/*.cfg ./Server/Scripts/Backup/ diff --git a/Server/Scripts/Backup/BackupGlobals.cfg b/Server/Root/Server/Scripts/Backup/BackupGlobals.cfg similarity index 100% rename from Server/Scripts/Backup/BackupGlobals.cfg rename to Server/Root/Server/Scripts/Backup/BackupGlobals.cfg diff --git a/Server/Scripts/Backup/CloudBackup.sh b/Server/Root/Server/Scripts/Backup/CloudBackup.sh similarity index 100% rename from Server/Scripts/Backup/CloudBackup.sh rename to Server/Root/Server/Scripts/Backup/CloudBackup.sh diff --git a/Server/Scripts/Backup/ExternalDataBackup.sh b/Server/Root/Server/Scripts/Backup/ExternalDataBackup.sh similarity index 100% rename from Server/Scripts/Backup/ExternalDataBackup.sh rename to Server/Root/Server/Scripts/Backup/ExternalDataBackup.sh diff --git a/Server/Scripts/Backup/ServerDataBackup.sh b/Server/Root/Server/Scripts/Backup/ServerDataBackup.sh similarity index 100% rename from Server/Scripts/Backup/ServerDataBackup.sh rename to Server/Root/Server/Scripts/Backup/ServerDataBackup.sh diff --git a/Server/diycron b/Server/Root/etc/diycron similarity index 100% rename from Server/diycron rename to Server/Root/etc/diycron diff --git a/Server/nginx/sites-available/articles b/Server/Root/etc/nginx/sites-available/articles similarity index 100% rename from Server/nginx/sites-available/articles rename to Server/Root/etc/nginx/sites-available/articles diff --git a/Server/nginx/sites-available/epic.octt.eu.org.conf b/Server/Root/etc/nginx/sites-available/epic.octt.eu.org.conf similarity index 100% rename from Server/nginx/sites-available/epic.octt.eu.org.conf rename to Server/Root/etc/nginx/sites-available/epic.octt.eu.org.conf diff --git a/Server/nginx/sites-available/feeds b/Server/Root/etc/nginx/sites-available/feeds similarity index 100% rename from Server/nginx/sites-available/feeds rename to Server/Root/etc/nginx/sites-available/feeds diff --git a/Server/nginx/sites-available/godo.octt.eu.org.conf b/Server/Root/etc/nginx/sites-available/godo.octt.eu.org.conf similarity index 100% rename from Server/nginx/sites-available/godo.octt.eu.org.conf rename to Server/Root/etc/nginx/sites-available/godo.octt.eu.org.conf diff --git a/Server/nginx/sites-available/librex b/Server/Root/etc/nginx/sites-available/librex similarity index 100% rename from Server/nginx/sites-available/librex rename to Server/Root/etc/nginx/sites-available/librex diff --git a/Server/nginx/sites-available/miss.octt.eu.org.conf b/Server/Root/etc/nginx/sites-available/miss.octt.eu.org.conf similarity index 100% rename from Server/nginx/sites-available/miss.octt.eu.org.conf rename to Server/Root/etc/nginx/sites-available/miss.octt.eu.org.conf diff --git a/Server/nginx/sites-available/root b/Server/Root/etc/nginx/sites-available/root similarity index 100% rename from Server/nginx/sites-available/root rename to Server/Root/etc/nginx/sites-available/root diff --git a/Tests/Home/.Configs.Test b/Tests/Home/.Configs.Test new file mode 100644 index 0000000..2a02d41 --- /dev/null +++ b/Tests/Home/.Configs.Test @@ -0,0 +1 @@ +TEST diff --git a/Tests/Root/.Configs.Test b/Tests/Root/.Configs.Test new file mode 100644 index 0000000..2a02d41 --- /dev/null +++ b/Tests/Root/.Configs.Test @@ -0,0 +1 @@ +TEST