shellcheck errors

This commit is contained in:
fosslinux 2019-03-09 04:16:03 +00:00
parent 383e45c3e8
commit 0d462acb07
1 changed files with 15 additions and 15 deletions

View File

@ -4,24 +4,24 @@ pw=$(pwgen -1B 10)
pwcrypt=$(perl -e "print crypt('${pw}', 'sa');")
# create account
useradd -m -g 100 -p ${pwcrypt} -s /bin/bash $1 || exit 1
useradd -m -g 100 -p "${pwcrypt}" -s /bin/bash "$1" || exit 1
# fix perms
chown -R $1:tilde /home/$1
chmod -R go-rx /home/$1
chmod go+x /home/$1
chmod go+rx /home/$1/public_html
chmod go+r /home/$1/public_html/*
chmod go+rx /home/$1/public_gopher
chmod go+r /home/$1/public_gopher/gophermap
chown -R "$1":tilde /home/"$1"
chmod -R go-rx /home/"$1"
chmod go+x /home/"$1"
chmod go+rx /home/"$1"/public_html
chmod go+r /home/"$1"/public_html/*
chmod go+rx /home/"$1"/public_gopher
chmod go+r /home/"$1"/public_gopher/gophermap
# ssh
mkdir /home/$1/.ssh
touch /home/$1/.ssh/authorized_keys
chmod 700 /home/$1/.ssh
chmod 600 /home/$1/.ssh/authorized_keys
echo "$3" | tee /home/$1/.ssh/authorized_keys
chown -R $1:tilde /home/$1/.ssh
mkdir /home/"$1"/.ssh
touch /home/"$1"/.ssh/authorized_keys
chmod 700 /home/"$1"/.ssh
chmod 600 /home/"$1"/.ssh/authorized_keys
echo "$3" | tee /home/"$1"/.ssh/authorized_keys
chown -R "$1":tilde /home/"$1"/.ssh
# send welcome email
sed -e "s/USERNAME/$1/g" -e "s/PASSWORD/${pw}/g" /var/aussie/emails/signup.tmpl | sendmail $1@aussies.space $2 fosslinux@aussies.space
sed -e "s/USERNAME/$1/g" -e "s/PASSWORD/${pw}/g" /var/aussie/emails/signup.tmpl | sendmail "$1"@aussies.space fosslinux@aussies.space