ServerTune provides -- managed and un-managed -- VPS hosting solutions at affordable prices to accommodate your personal and/or businesses needs.
Click here for more info ...

Browse by category
Search | Advanced search
This is HowTo make all files uploaded through the Filemanager chmod to 700.
You need the following shell script. SSH to the server and follow these steps (in that order):
#!/bin/sh
CHMODVAL=700
ULPATH=/home/$$
setfile() {
if [ "$1" = "" ]; then
return;
fi
F=`echo $1 | cut -d/ -f4 | awk '{ print substr($1,1,length($1)-6) }'`
chmod $ $$
}
TMP=/tmp/txt.txt
if [ "$command" = "/CMD_FILE_MANAGER/" ] || [ "$command" == "/CMD_FILE_MANAGER" ]; then
if [ "$action" = "upload" ]; then
setfile $file1
setfile $file2
setfile $file3
setfile $file4
setfile $file5
setfile $file6
setfile $file7
setfile $file8
fi
fi
exit 0;
Hold down the Ctrl button and press the letter D on your keyboard to create and save the all_post.sh file.
To use the script, run the following command: