forked from tylda-public/helpers
shellcheck: quote params
This commit is contained in:
14
add_user.sh
14
add_user.sh
@@ -92,14 +92,14 @@ echo "+cpu +memory" > "$CG_ROOT/cgroup.subtree_control" 2>/dev/null || true
|
|||||||
USER_CG="$CG_ROOT/$LOGIN"
|
USER_CG="$CG_ROOT/$LOGIN"
|
||||||
mkdir "$USER_CG"
|
mkdir "$USER_CG"
|
||||||
|
|
||||||
mkdir -p /home/$LOGIN/.ssh
|
mkdir -p "/home/$LOGIN/.ssh"
|
||||||
mkdir -p /home/$LOGIN/.gnupg
|
mkdir -p "/home/$LOGIN/.gnupg"
|
||||||
touch /home/$LOGIN/public_html/.webring
|
touch "/home/$LOGIN/public_html/.webring"
|
||||||
|
|
||||||
chmod 0700 /home/$LOGIN/.ssh
|
chmod 0700 "/home/$LOGIN/.ssh"
|
||||||
chmod 0700 /home/$LOGIN/.gnupg
|
chmod 0700 "/home/$LOGIN/.gnupg"
|
||||||
|
|
||||||
chown -R $LOGIN:$LOGIN /home/$LOGIN/
|
chown -R "$LOGIN":"$LOGIN" "/home/$LOGIN/"
|
||||||
|
|
||||||
curl -X POST https://cloud.tylda.org/ocs/v1.php/cloud/users -d userid="$LOGIN" -d password="$PASS" -H "OCS-APIRequest: true" -u "$NEXTCLOUD_USER:$NEXTCLOUD_PASS"
|
curl -X POST https://cloud.tylda.org/ocs/v1.php/cloud/users -d userid="$LOGIN" -d password="$PASS" -H "OCS-APIRequest: true" -u "$NEXTCLOUD_USER:$NEXTCLOUD_PASS"
|
||||||
curl -X PUT "https://cloud.tylda.org/ocs/v1.php/cloud/users/$LOGIN" -H "OCS-APIRequest: true" -u "$NEXTCLOUD_USER:$NEXTCLOUD_PASS" -d key="quota" -d value="250MB"
|
curl -X PUT "https://cloud.tylda.org/ocs/v1.php/cloud/users/$LOGIN" -H "OCS-APIRequest: true" -u "$NEXTCLOUD_USER:$NEXTCLOUD_PASS" -d key="quota" -d value="250MB"
|
||||||
@@ -109,7 +109,7 @@ cp welcome_tmp.txt welcome.txt
|
|||||||
echo "Login: $LOGIN" >> welcome.txt
|
echo "Login: $LOGIN" >> welcome.txt
|
||||||
echo "Hasło: $PASS" >> welcome.txt
|
echo "Hasło: $PASS" >> welcome.txt
|
||||||
|
|
||||||
sendmail -f v0id1st@tylda.org $LOGIN@tylda.org < welcome.txt
|
sendmail -f v0id1st@tylda.org "$LOGIN@tylda.org" < welcome.txt
|
||||||
|
|
||||||
rm -f welcome.txt
|
rm -f welcome.txt
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user