| Revision 1165,
1.2 KB
checked in by root, 10 years ago
(diff) |
|
et hop, un petit IF EXISTS
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | #!/bin/sh -e |
|---|
| 2 | |
|---|
| 3 | # Cette fonction regarde si un fichier de config ($1) a déjà reçu une modif |
|---|
| 4 | # de config, et si oui, lui enleve les lignes voulues |
|---|
| 5 | function unconfigure { |
|---|
| 6 | if grep -qs "\*\*\*MAILMAN\*\*\*" $1 |
|---|
| 7 | then |
|---|
| 8 | # 1. on déplace le fichier |
|---|
| 9 | rm -f $1.alternc_mailman |
|---|
| 10 | cat $1 | grep -v "\*\*\*MAILMAN\*\*\*" | grep -v " Alias /marchives/ /var/lib/mailman/archives/public/" | grep -v "Alias /mimages/ /usr/share/images/mailman/" >$1.alternc_mailman |
|---|
| 11 | mv -f $1.alternc_mailman $1 |
|---|
| 12 | fi |
|---|
| 13 | } |
|---|
| 14 | |
|---|
| 15 | if [ "$1" = "purge" ] |
|---|
| 16 | then |
|---|
| 17 | unconfigure /etc/apache/httpd.conf |
|---|
| 18 | unconfigure /etc/apache-ssl/httpd.conf |
|---|
| 19 | unconfigure /usr/share/alternc/1.0/install/etc/apache/httpd.conf |
|---|
| 20 | unconfigure /usr/share/alternc/1.0/install/etc/apache-ssl/httpd.conf |
|---|
| 21 | . /etc/alternc/local.sh |
|---|
| 22 | mysql -f -u"$MYSQL_USER" -p"$MYSQL_PASS" "$MYSQL_DATABASE" -e "DROP TABLE IF EXISTS mailman" |
|---|
| 23 | MENUFILE=/var/alternc/bureau/admin/menulist.txt |
|---|
| 24 | if grep -qs "menu_mailman.php" $MENUFILE |
|---|
| 25 | then |
|---|
| 26 | rm -f $MENUFILE.alternc_mailman |
|---|
| 27 | cat $MENUFILE | grep -v "menu_mailman.php" >$MENUFILE.alternc_mailman |
|---|
| 28 | mv -f $MENUFILE.alternc_mailman $MENUFILE |
|---|
| 29 | fi |
|---|
| 30 | fi |
|---|
| 31 | # purge |
|---|
| 32 | |
|---|
| 33 | # dh_installdeb will replace this with shell code automatically |
|---|
| 34 | # generated by other debhelper scripts. |
|---|
| 35 | #DEBHELPER# |
|---|
Note: See
TracBrowser
for help on using the repository browser.