Detailed explanation of installing shell script with one click under linxu
- 2021-07-24 12:12:24
- OfStack
#!/bin/bash
# Download svn
yum -y install subversion
# Alibaba Cloud oss Information
wget -P /root https://babyrita.oss-cn-beijing.aliyuncs.com/lnmp/quyeweb/ziliao.zip
# Extract data file
unzip ziliao.zip
# New svndata Directory
mkdir /home/svndata
#svn Server listening Default 3690 Port
svnserve -d -r /home/svndata
# Create svn Warehouse
svnadmin create /home/svndata/www
# Copy data to the corresponding location
\cp /root/ziliao/passwd.txt /home/svndata/www/conf/passwd
\cp /root/ziliao/svnserve.txt /home/svndata/www/conf/svnserve.conf
\cp /root/ziliao/post-commit.txt /home/svndata/www/hooks/post-commit
# Hook file executable
chmod +x /home/svndata/www/hooks/post-commit
cd /home/svndata/www/
# Detect svn To the local and to the root directory of the website --- Automation -- No password input
svn co svn://127.0.0.1/www --username svn1113 --password svn123 --no-auth-cache
svn co svn://127.0.0.1/www /home/wwwroot/www --username svn1113 --password svn123 --no-auth-cache
# Create users and user groups
groupadd www
useradd -g www www
# Set the permissions of the site directory
chown -R www:www /home/wwwroot/www
Add knowledge points: Let's take a look at the linux shell script svn automatically updates the project and packages, publishes and backs it up
Prepare a configuration file for saving svn address, destination path, user name and password
Configuration file name: toolConfig. properties
#svn Address
svnAddress=https://192.168.1.253/ " yourPath "
# Local path (destination address)
localDir=E:\shelltest
#svn User name
userName=jack
#svn Password
password=123456
Corresponding to shell script
#!/bin/bash
source ./toolConfig.properties
svn_ip=${svnAddress}
local_path=${localDir}
u_name=${userName}
p_wd=${password}
svn co ${svn_ip} ${local_path} --username ${u_name} --password ${p_wd}
Summarize
The above is under linxu Svn1 key installation shell script details, more about linux 1 key installation shell script please pay attention to other related articles on this site!