0

I am working on a script to fix wordpress perms.

I want the script to take the username of a hosting account, and then output the users input into a few commands, see below # sets default perms on all files and folders below

    echo -n "Enter username: "
read -a USER

echo "username is $USER"
# reset to safe defaults
echo "resetting to safe defaults"
# sets default perms on all files and folders

find /home/$USER/public_html/ - type f -exec chmod 644 {} +
find /home/$USER/public_html/ - type d -exec chmod 755 {} +
chmod 660 /home/$USER/public_html/wp-config.php
echo "done"

This is the output I am getting

    [root@server ~]# bash wp-perms.sh
Enter username: adrobbiepowellco
username is adrobbiepowellco
resetting to safe defaults
find: ‘-’: No such file or directory
find: ‘type’: No such file or directory
find: ‘f’: No such file or directory
find: ‘-’: No such file or directory
find: ‘type’: No such file or directory
find: ‘d’: No such file or directory
done
[root@server ~]#

The actual commands run fine, when running for example - find /home/adrobbiepowellco/public_html/ - type f -exec chmod 644 {} + , from the home directory.

Any help greatly apreciated.

0 Answers0