ok maybe tho
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good
This commit is contained in:
parent
d24a36d7aa
commit
a98147901c
@ -222,7 +222,7 @@ pipeline {
|
||||
curl -u '${env.GITEA_USR}:${env.GITEATOKEN}' https://gitea.arg.rip/greyn/deployment/raw/branch/service/scripts/serviceaccount.sh --output serviceaccount.sh
|
||||
sed -i 's/USERNAMETOADD=/USERNAMETOADD="${servicename}"/' serviceaccount.sh
|
||||
sed -i 's/PASSWORDTOADD=/PASSWORDTOADD="${env.pw_linuxserviceaccount}"/' serviceaccount.sh
|
||||
sed -i 's/PUBKEYCONTENT=/PUBKEYCONTENT="\$(cat ${servicename}-ssh.pub)"/' serviceaccount.sh
|
||||
sed -i "s/PUBKEYCONTENT=/PUBKEYCONTENT=\"\$(cat ${servicename}-ssh.pub)"/\" serviceaccount.sh
|
||||
sed -i 's/SUDOER_PSW=/SUDOER_PSW="${SUDOER_PSW}"/' serviceaccount.sh
|
||||
|
||||
echo "serviceaccount :)"
|
||||
|
@ -12,10 +12,11 @@ function restofscript(){
|
||||
cd ~/home/${USERNAMETOADD}
|
||||
mkdir .ssh
|
||||
pushd .ssh
|
||||
echo ${PUBKEYCONTENT} > authorized_keys
|
||||
pwd
|
||||
echo ${PUBKEYCONTENT} >> authorized_keys
|
||||
chmod 600 authorized_keys
|
||||
popd
|
||||
chown -R '${USERNAMETOADD}:${USERNAMETOADD}' .ssh
|
||||
chown -R "${USERNAMETOADD}:${USERNAMETOADD}" .ssh
|
||||
}
|
||||
|
||||
echo "${SUDOER_PSW}" | sudo -S bash -c "$(declare -f restofscript); restofscript"
|
||||
|
Loading…
Reference in New Issue
Block a user