help on web folder script
I writing a script that creates a webfolder , set permissons, ownership and copies a sample index, for user that are requesting web space on my server. For some reason the if statment in my script doesnt seem to work properly, here 's what i got
#!/bin/bash
# webspace creater tool built by seejay@n3tlab
me=$(whoami)
choice=" "
clear
#intro for user
echo With your existing shell account you can create a web page you can access threw your account, but you must know html in order to use this feature, are you sure you want to create a web account ? yes or no
read choice
# if user says yes there dir is created in the web folder
if [$choice="yes"]
then
mkdir /var/www/html/freespace/$me/
echo your web folder is /var/www/html/freespace/$me/ and can be viewed at http://n3tlab.hopto.org/freespace/$me/
# set permissions and ownership
chown $me /var/www/html/freespace/$me
chmod 755 /var/www/html/freespace/$me
# copy sample index to web folder
cp /usr/bin/index.html /var/www/html/freespace/$me
exit
#if user says no or anything else
else
echo your web folder will not be created, thanks for using n3tlab
exit
fi
# all done
The script will run but no matter what the user inputs the script outputs a error "
/usr/bin/webhosting: line 12: [yes=yes]: command not found
your web folder will not be created, thanks for using n3tlab
[seejay@localhost seejay]$ "
i think that it's not reconizing the if statment properly, can some one please help me?
|