forked from tripflex/scripts
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcpremovefrontpage
More file actions
executable file
·29 lines (23 loc) · 843 Bytes
/
cpremovefrontpage
File metadata and controls
executable file
·29 lines (23 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Remove Frontpage Extension for all accounts in cPanel server
USERDIR='/var/cpanel/users'
read -p "Are you sure you remove FP extension for all domains? <y/N> " prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
then
u=`ls -l $USERDIR | egrep '^-' | wc -l`
for (( i=1; i<=$u; i++ ))
do
user=`ls -l $USERDIR | egrep '^-' | awk {'print $9'} | head -$i | tail -1`
echo "Checking user $user FrontPage status.."
if [ -d /home/$user/public_html/_vti_pvt ]; then
domain="cat $USERDIR/$user | grep 'DNS=' | sed 's/DNS=//'"
echo "FrontPage found. Removing FrontPage for $domain"
/scripts/unsetupfp4 $domain
else
echo "FrontPage not found for $user"
fi
done
echo "Process completed"
else
exit 0
fi