From 809dbd39fb67b63c80e0e1d74ea25919583f64b9 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Mon, 16 Dec 2019 10:05:22 +0800 Subject: [PATCH] u --- setup-debian.sh => config-debian.sh | 2 +- config-home.sh | 55 +++++++++++++++++++ setup-homebrew.sh => install-homebrew.sh | 0 setup-mongodb.sh => install-mongodb.sh | 0 ...p-node-by-nvm.sh => install-node-by-nvm.sh | 0 setup-node.sh => install-node.sh | 0 setup-ssr.sh => install-ssr.sh | 0 rsync2remote.sh => run-rsync.sh | 0 run-git.sh => serve-git.sh | 0 run-svn.sh => serve-svn.sh | 0 run-yapi.sh => serve-yapi.sh | 0 setup-home.sh | 34 ------------ 12 files changed, 56 insertions(+), 35 deletions(-) rename setup-debian.sh => config-debian.sh (97%) create mode 100755 config-home.sh rename setup-homebrew.sh => install-homebrew.sh (100%) rename setup-mongodb.sh => install-mongodb.sh (100%) rename setup-node-by-nvm.sh => install-node-by-nvm.sh (100%) rename setup-node.sh => install-node.sh (100%) rename setup-ssr.sh => install-ssr.sh (100%) rename rsync2remote.sh => run-rsync.sh (100%) rename run-git.sh => serve-git.sh (100%) rename run-svn.sh => serve-svn.sh (100%) rename run-yapi.sh => serve-yapi.sh (100%) delete mode 100755 setup-home.sh diff --git a/setup-debian.sh b/config-debian.sh similarity index 97% rename from setup-debian.sh rename to config-debian.sh index 0864239..a8ff2a2 100755 --- a/setup-debian.sh +++ b/config-debian.sh @@ -32,7 +32,7 @@ fi echo "<<< Configure home" if [ ! -f "~/.bashrc.backup" ] then - . /faronear/lib/sysconfig/setup-home.sh + . /faronear/lib/sysconfig/config-home.sh /faronear/lib/sysconfig fi echo "<<< Change root password" diff --git a/config-home.sh b/config-home.sh new file mode 100755 index 0000000..7053991 --- /dev/null +++ b/config-home.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +echo "Usage: setup.sh [Source-Path-To-Config-Files]" +echo " (default to /faronear/lib/sysconfig)" +echo "---------------------------------------------" + +if [ $1 ] +then + SourcePath=$1 +else + read -p "Enter config source path : " SourcePath + if [ ! $SourcePath ] + then + echo Use default source path: /faronear/lib/sysconfig + SourcePath=/faronear/lib/sysconfig + fi +fi + +if [ ! -d $SourcePath ] +then + echo !!! Not existing $SourcePath, please try again +else + echo "Config home from $SourcePath" + if [ -e ~/.emacs ] + then + mv ~/.emacs ~/.emacs.backup + fi + rm -fr ~/.emacs + ln -s $SourcePath/.emacs ~/ + + if [ -e ~/.emacs.lisp ] + then + mv ~/.emacs.lisp ~/.emacs.lisp.backup + fi + rm -fr ~/.emacs.lisp + ln -s $SourcePath/.emacs.lisp ~/ + + if [ -e ~/.bashrc ] + then + mv ~/.bashrc ~/.bashrc.backup + fi + rm -fr ~/.bashrc + ln -s $SourcePath/.bashrc ~/ + + if [ -e ~/.bash_profile ] + then + mv ~/.bash_profile ~/.bash_profile.backup + fi + rm -fr ~/.bash_profile + ln -s $SourcePath/.bash_profile ~/ + + . ~/.bashrc + + echo "^_^ Home Setting Complete" +fi \ No newline at end of file diff --git a/setup-homebrew.sh b/install-homebrew.sh similarity index 100% rename from setup-homebrew.sh rename to install-homebrew.sh diff --git a/setup-mongodb.sh b/install-mongodb.sh similarity index 100% rename from setup-mongodb.sh rename to install-mongodb.sh diff --git a/setup-node-by-nvm.sh b/install-node-by-nvm.sh similarity index 100% rename from setup-node-by-nvm.sh rename to install-node-by-nvm.sh diff --git a/setup-node.sh b/install-node.sh similarity index 100% rename from setup-node.sh rename to install-node.sh diff --git a/setup-ssr.sh b/install-ssr.sh similarity index 100% rename from setup-ssr.sh rename to install-ssr.sh diff --git a/rsync2remote.sh b/run-rsync.sh similarity index 100% rename from rsync2remote.sh rename to run-rsync.sh diff --git a/run-git.sh b/serve-git.sh similarity index 100% rename from run-git.sh rename to serve-git.sh diff --git a/run-svn.sh b/serve-svn.sh similarity index 100% rename from run-svn.sh rename to serve-svn.sh diff --git a/run-yapi.sh b/serve-yapi.sh similarity index 100% rename from run-yapi.sh rename to serve-yapi.sh diff --git a/setup-home.sh b/setup-home.sh deleted file mode 100755 index 9f53d46..0000000 --- a/setup-home.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -echo "Usage: setup.sh" -echo "Example: setup.sh" - -echo "######## Setting Home ##################" - -if [ -e ~/.emacs ] -then - mv ~/.emacs ~/.emacs.backup -fi -ln -s /faronear/lib/sysconfig/.emacs ~/ - -if [ -e ~/.emacs.lisp ] -then - mv ~/.emacs.lisp ~/.emacs.lisp.backup -fi -ln -s /faronear/lib/sysconfig/.emacs.lisp ~/ - -if [ -e ~/.bashrc ] -then - mv ~/.bashrc ~/.bashrc.backup -fi -ln -s /faronear/lib/sysconfig/.bashrc ~/ - -if [ -e ~/.bash_profile ] -then - mv ~/.bash_profile ~/.bash_profile.backup -fi -ln -s /faronear/lib/sysconfig/.bash_profile ~/ - -. ~/.bashrc - -echo "######## Home Setting Complete ##################"