Project

General

Profile

Paste
Download (852 Bytes) Statistics
| Branch: | Revision:

root / bin / d7-delete-site.sh @ d52a5b2f

1
#!/bin/sh
2

    
3
. /users/guest/assos/bin/scripts-config.sh
4
. scripts-config-site.sh $1
5
. scripts-utils.sh
6

    
7
help="# ARGS: site name."
8

    
9
check_arguments $# 1 "$help"
10

    
11
db_password=`ask_password_db $db_server $db_user`
12

    
13
# Delete database.
14
mysql -h $db_server -u $db_user -p$db_password -e "DROP DATABASE $d7_site_name"
15

    
16
# Delete MYSQL user.
17
mysql -h $db_server -u $db_user -p$db_password -e "DROP USER '$d7_site_name'@'%'"
18

    
19
# Delete site's folder.
20
chmod -R 700 $d7_site_dir
21
rm -r $d7_site_dir
22

    
23
# Delete symbolic link.
24
rm $d7_dir/$d7_site_name
25

    
26
# Delete database backups.
27
rm -r $d7_dir_individual_auto_backup/assos.centrale-marseille.fr.$d7_site_name
28
rm -r $d7_dir_individual_manual_backup/assos.centrale-marseille.fr.$d7_site_name
29

    
30
echo "Don't forget to:"
31
echo "- Refresh node site on default"
32
echo "- Check particular behavior (normally detailed on site node)"