批量重命名,把关键词放在前面,动作词放在后面
This commit is contained in:
		
							parent
							
								
									1edf66b260
								
							
						
					
					
						commit
						4cd12adc62
					
				
							
								
								
									
										11
									
								
								debian-install.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								debian-install.sh
									
									
									
									
									
										Executable file
									
								
							| @ -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/' | ||||||
							
								
								
									
										102
									
								
								expect-ssh2server.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										102
									
								
								expect-ssh2server.sh
									
									
									
									
									
										Executable file
									
								
							| @ -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 | ||||||
| @ -42,12 +42,8 @@ then | |||||||
|     ln -s $SourcePath/$homescript $HomePath |     ln -s $SourcePath/$homescript $HomePath | ||||||
|   done |   done | ||||||
|   popd |   popd | ||||||
|   if [ ! -d $HomePath/.ssh ] |   mkdir -p $HomePath/.ssh | ||||||
|   then |   chmod 700 $HomePath/.ssh | ||||||
|     echo "--- Creating $HomePath/.ssh ..." |  | ||||||
|     mkdir $HomePath/.ssh |  | ||||||
|     chmod 700 $HomePath/.ssh |  | ||||||
|   fi |  | ||||||
|   if [ -e $HomePath/.ssh/authorized_keys ] |   if [ -e $HomePath/.ssh/authorized_keys ] | ||||||
|   then |   then | ||||||
|     echo "--- Removing $HomePath/.ssh/authorized_keys ..." |     echo "--- Removing $HomePath/.ssh/authorized_keys ..." | ||||||
| @ -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/' |  | ||||||
| @ -90,6 +90,9 @@ then | |||||||
| 	source ~/.bashrc_custom | 	source ~/.bashrc_custom | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | # align for vscode-sshfs in MacOS and windows | ||||||
|  | export USERPROFILE=$HOME | ||||||
|  | 
 | ||||||
| ################################################################################ | ################################################################################ | ||||||
| # End Of File: "~/.bashrc" | # End Of File: "~/.bashrc" | ||||||
| ################################################################################ | ################################################################################ | ||||||
|  | |||||||
| @ -32,6 +32,6 @@ popd | |||||||
| 
 | 
 | ||||||
| sudo apt install nginx -y | sudo apt install nginx -y | ||||||
| rm /etc/nginx/sites-enabled/default | rm /etc/nginx/sites-enabled/default | ||||||
| cp /faronear/fon/sysconfig/nginx-seafile-http.conf /faronear/bin-seafile/ | cp /faronear/fon/sysconfig/seafile-nginx-http.conf /faronear/bin-seafile/ | ||||||
| ln -s /faronear/bin-seafile/nginx-seafile-http.conf /etc/nginx/sites-enabled/ | ln -s /faronear/bin-seafile/seafile-nginx-http.conf /etc/nginx/sites-enabled/ | ||||||
| service nginx restart | service nginx restart | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user