Skip to content

Commit

Permalink
fixed sohutv#312 修复对目录更改所属组是错误传递密码过去
Browse files Browse the repository at this point in the history
  • Loading branch information
carryaimp committed Aug 17, 2023
1 parent 327e40a commit 8aea2bd
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions redis-ecs/script/cachecloud-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ checkExist() {
echo -e "\033[41;36m delete existed user: $1. \033[0m"
userdel -r "$1"
createUser "$1" "$2"
init "$1"
init "$1" "$1
return 0
fi
else
createUser "$1" "$2"
init "$1"
init "$1" "$1"
fi
return 0
}
Expand Down Expand Up @@ -87,11 +87,11 @@ init() {
mkdir -p /data/redis
# change owner
chown -R $1:$1 /opt/cachecloud
chown -R $1:$1 /tmp/cachecloud
chown -R $1:$1 /home/$1
chown -R $1 /var/run
chown -R $1:$1 /data/redis
chown -R $1:$2 /opt/cachecloud
chown -R $1:$2 /tmp/cachecloud
chown -R $1:$2 /home/$1
chown -R $1:$2 /var/run
chown -R $1:$2 /data/redis
echo -e "\033[41;36m OK: init done. \033[0m"
}
Expand All @@ -114,9 +114,9 @@ output() {
echo "swappiness="
cat /proc/sys/vm/swappiness
echo "user="
cat /etc/passwd | grep cachecloud
cat /etc/passwd | grep $1
echo "auth_key="
cat /home/$1/.ssh/authorized_keys
[ -f "/home/$1/.ssh/authorized_keys" ] && cat /home/$1/.ssh/authorized_keys
echo "sshpass="
sshpass -V | head -1
Expand All @@ -135,7 +135,7 @@ installRedis() {
if [[ $? == 0 ]]; then
echo -e "\033[41;36m OK: ${redisTarGz} is installed, exit. \033[0m"
chown -R $1:$2 ${redisDir}
chown -R $1:$1 ${redisDir}
if [[ ${redisVersion} == "redis-5.0.9" ]]; then
export PATH=$PATH:${redisDir}/src
echo $PATH
Expand Down Expand Up @@ -170,3 +170,4 @@ installSshpass
output "${username}"
# 6.install install
installRedis "${username}" "${password}"

0 comments on commit 8aea2bd

Please sign in to comment.