diff --git a/config-debian.sh b/debian-config.sh similarity index 100% rename from config-debian.sh rename to debian-config.sh diff --git a/debian-install.sh b/debian-install.sh new file mode 100755 index 0000000..2707337 --- /dev/null +++ b/debian-install.sh @@ -0,0 +1,11 @@ +read -p "Enter root password (default to 'MoeClub.org') >> " ROOTPWD + +read -p "Enter debian version to install (default to 11)>> " DEBIAN_VERSION +if [ -z "${DEBIAN_VERSION}" ] +then + DEBIAN_VERSION=11 +fi + +apt-get update +apt-get install -y xz-utils openssl gawk file net-tools wget +bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d $DEBIAN_VERSION -v 64 -a -firmware -p "$ROOTPWD" --mirror 'https://mirrors.huaweicloud.com/debian/' \ No newline at end of file diff --git a/install-docker.sh b/docker-install.sh similarity index 100% rename from install-docker.sh rename to docker-install.sh diff --git a/expect-ssh2server.sh b/expect-ssh2server.sh new file mode 100755 index 0000000..d778e77 --- /dev/null +++ b/expect-ssh2server.sh @@ -0,0 +1,102 @@ +local=killer-sDeb10-vMac.local +us1=us-nj-1.faronear.net +us2=us-nj-2.faronear.net +de1=de-1.faronear.net +de2=de-2.faronear.net +de3=de-3-arm.faronear.net +de4=de-4-arm.faronear.net +sh=cn-sh.faronear.net +wx=cn-wx.farinear.cn + +if [ $1 ] +then + TARGET=$1 +else + echo Connect to + echo " local : $local" + echo " us1 : $us1" + echo " us2 : $us2" + echo " de1 : $de1" + echo " de2 : $de2" + echo " de3 : $de3" + echo " de4 : $de4" + echo " sh : $sh" + echo " wx : $wx" + echo " other : specify host/user/pwd" + echo + read -p "Enter target (default to other)>> " TARGET + if [ ! $TARGET ] + then + TARGET=other + fi +fi + +if [ $TARGET = "local" ] +then + read -p "Enter adot password (ROAD) >>" PWD_ADOT + read -p "Enter root password (YU) >>" PWD_ROOT + expect ~/faronear/fon/sysconfig/expect-ssh.sh $local adot $PWD_ADOT $PWD_ADOT +elif [ $TARGET = 'us1' ] +then + read -p "Enter adot password (ROAD) >>" PWD_ADOT + read -p "Enter root password (YU) >>" PWD_ROOT + expect ~/faronear/fon/sysconfig/expect-ssh.sh $us1 adot $PWD_ADOT $PWD_ROOT +elif [ $TARGET = 'us2' ] +then + read -p "Enter adot password (ROAD) >>" PWD_ADOT + read -p "Enter root password (YU) >>" PWD_ROOT + expect ~/faronear/fon/sysconfig/expect-ssh.sh $us2 adot $PWD_ADOT $PWD_ROOT +elif [ $TARGET = 'de1' ] +then + read -p "Enter adot password (ROAD) >>" PWD_ADOT + read -p "Enter root password (YU) >>" PWD_ROOT + expect ~/faronear/fon/sysconfig/expect-ssh.sh $de1 adot $PWD_ADOT $PWD_ROOT +elif [ $TARGET = 'de2' ] +then + read -p "Enter adot password (ROAD) >>" PWD_ADOT + read -p "Enter root password (YU) >>" PWD_ROOT + expect ~/faronear/fon/sysconfig/expect-ssh.sh $de2 adot $PWD_ADOT $PWD_ROOT +elif [ $TARGET = 'de3' ] +then + read -p "Enter adot password (ROAD) >>" PWD_ADOT + read -p "Enter root password (YU) >>" PWD_ROOT + expect ~/faronear/fon/sysconfig/expect-ssh.sh $de3 adot $PWD_ADOT $PWD_ROOT +elif [ $TARGET = 'de4' ] +then + read -p "Enter adot password (ROAD) >>" PWD_ADOT + read -p "Enter root password (YU) >>" PWD_ROOT + expect ~/faronear/fon/sysconfig/expect-ssh.sh $de4 adot $PWD_ADOT $PWD_ROOT +elif [ $TARGET = 'sh' ] +then + read -p "Enter adot password (ROAD) >>" PWD_ADOT + read -p "Enter root password (YU) >>" PWD_ROOT + expect ~/faronear/fon/sysconfig/expect-ssh.sh $sh adot $PWD_ADOT $PWD_ROOT +elif [ $TARGET = 'wx' ] +then + read -p "Enter adot password (ROAD) >>" PWD_ADOT + read -p "Enter root password (YU) >>" PWD_ROOT + expect ~/faronear/fon/sysconfig/expect-ssh.sh $wx adot $PWD_ADOT $PWD_ROOT +else + echo Other target is selected. Please specify details of the target: + while [ ! $HOST ] + do + read -p "host = " HOST + done + + while [ ! $USER ] + do + read -p "user = " USER + done + + while [ ! $PWD_USER ] + do + read -p "user password = " PWD_USER + done + + while [ ! $PWD_SU ] + do + read -p "root password = " ROOT_SU + done + + expect ~/faronear/fon/sysconfig/expect-ssh.sh $HOST $USER $PWD_USER $PWD_SU +fi diff --git a/config-git.sh b/git-config.sh similarity index 100% rename from config-git.sh rename to git-config.sh diff --git a/serve-gitea.sh b/gitee-run.sh similarity index 100% rename from serve-gitea.sh rename to gitee-run.sh diff --git a/change-gogs-hook-path.sh b/gogs-change-hook-path.sh similarity index 100% rename from change-gogs-hook-path.sh rename to gogs-change-hook-path.sh diff --git a/serve-gogs-http2https.sh b/gogs-run-http2https.sh similarity index 100% rename from serve-gogs-http2https.sh rename to gogs-run-http2https.sh diff --git a/serve-gogs.sh b/gogs-run.sh similarity index 100% rename from serve-gogs.sh rename to gogs-run.sh diff --git a/config-home.sh b/home-config.sh similarity index 91% rename from config-home.sh rename to home-config.sh index 700676d..72cd37b 100755 --- a/config-home.sh +++ b/home-config.sh @@ -42,12 +42,8 @@ then ln -s $SourcePath/$homescript $HomePath done popd - if [ ! -d $HomePath/.ssh ] - then - echo "--- Creating $HomePath/.ssh ..." - mkdir $HomePath/.ssh - chmod 700 $HomePath/.ssh - fi + mkdir -p $HomePath/.ssh + chmod 700 $HomePath/.ssh if [ -e $HomePath/.ssh/authorized_keys ] then echo "--- Removing $HomePath/.ssh/authorized_keys ..." diff --git a/install-debian11.sh b/install-debian11.sh deleted file mode 100755 index 56e5e48..0000000 --- a/install-debian11.sh +++ /dev/null @@ -1,5 +0,0 @@ -read -p "Enter root password or leave blank for default 'MoeClub.org' >> " ROOTPWD - -apt-get update -apt-get install -y xz-utils openssl gawk file net-tools wget -bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 11 -v 64 -a -firmware -p "$ROOTPWD" --mirror 'https://mirrors.huaweicloud.com/debian/' \ No newline at end of file diff --git a/install-lamp.sh b/lamp-install.sh similarity index 100% rename from install-lamp.sh rename to lamp-install.sh diff --git a/add-user.sh b/linux-add-user.sh similarity index 100% rename from add-user.sh rename to linux-add-user.sh diff --git a/install-lnmp.sh b/lnmp-install.sh similarity index 100% rename from install-lnmp.sh rename to lnmp-install.sh diff --git a/install-mongodb.sh b/mongodb-install.sh similarity index 100% rename from install-mongodb.sh rename to mongodb-install.sh diff --git a/nixhome/.bashrc b/nixhome/.bashrc index 96986fa..5c2aa66 100644 --- a/nixhome/.bashrc +++ b/nixhome/.bashrc @@ -90,6 +90,9 @@ then source ~/.bashrc_custom fi +# align for vscode-sshfs in MacOS and windows +export USERPROFILE=$HOME + ################################################################################ # End Of File: "~/.bashrc" ################################################################################ diff --git a/install-nodejs-centos.sh b/nodejs-install-centos.sh similarity index 100% rename from install-nodejs-centos.sh rename to nodejs-install-centos.sh diff --git a/install-nodejs.sh b/nodejs-install.sh similarity index 100% rename from install-nodejs.sh rename to nodejs-install.sh diff --git a/install-nvm.sh b/nvm-install.sh similarity index 100% rename from install-nvm.sh rename to nvm-install.sh diff --git a/run-rsync.sh b/remote-sync.sh similarity index 100% rename from run-rsync.sh rename to remote-sync.sh diff --git a/install-seafile.sh b/seafile-install.sh similarity index 92% rename from install-seafile.sh rename to seafile-install.sh index 48194da..2144e7e 100755 --- a/install-seafile.sh +++ b/seafile-install.sh @@ -32,6 +32,6 @@ popd sudo apt install nginx -y rm /etc/nginx/sites-enabled/default -cp /faronear/fon/sysconfig/nginx-seafile-http.conf /faronear/bin-seafile/ -ln -s /faronear/bin-seafile/nginx-seafile-http.conf /etc/nginx/sites-enabled/ +cp /faronear/fon/sysconfig/seafile-nginx-http.conf /faronear/bin-seafile/ +ln -s /faronear/bin-seafile/seafile-nginx-http.conf /etc/nginx/sites-enabled/ service nginx restart diff --git a/nginx-seafile-http.conf b/seafile-nginx-http.conf similarity index 100% rename from nginx-seafile-http.conf rename to seafile-nginx-http.conf diff --git a/nginx-seafile-https.conf b/seafile-nginx-https.conf similarity index 100% rename from nginx-seafile-https.conf rename to seafile-nginx-https.conf diff --git a/serve-seafile.sh b/seafile-run.sh similarity index 100% rename from serve-seafile.sh rename to seafile-run.sh diff --git a/add-rsapub-to-remote.sh b/ssh-pubkey-to-remote.sh similarity index 100% rename from add-rsapub-to-remote.sh rename to ssh-pubkey-to-remote.sh diff --git a/install-ssr.sh b/ssr-install.sh similarity index 100% rename from install-ssr.sh rename to ssr-install.sh diff --git a/remove-ssr.sh b/ssr-uninstall.sh similarity index 100% rename from remove-ssr.sh rename to ssr-uninstall.sh diff --git a/serve-svn.sh b/svn-run.sh similarity index 100% rename from serve-svn.sh rename to svn-run.sh diff --git a/mount-blockstorage-vultr.sh b/vultr-mount-blockstorage.sh similarity index 100% rename from mount-blockstorage-vultr.sh rename to vultr-mount-blockstorage.sh diff --git a/serve-yapi.sh b/yapi-run.sh similarity index 100% rename from serve-yapi.sh rename to yapi-run.sh