add alternc_get_path, to figure out if a path is available on the web

This commit is contained in:
Antoine Beaupré 2009-11-28 22:51:53 +00:00
parent b5b69d9a59
commit f7004a0fc0
3 changed files with 12 additions and 0 deletions

1
.gitattributes vendored
View File

@ -439,6 +439,7 @@ src/update_domains.sh -text
tests/mechdump.pm -text tests/mechdump.pm -text
tests/test_demo.pl -text tests/test_demo.pl -text
tests/whois_test.php -text tests/whois_test.php -text
tools/alternc_get_path -text
tools/get_account_by_domain -text tools/get_account_by_domain -text
tools/get_domains_by_account -text tools/get_domains_by_account -text
tools/top_ftp_users -text tools/top_ftp_users -text

1
debian/rules vendored
View File

@ -74,6 +74,7 @@ install: build
install tools/top_ftp_users debian/alternc/usr/bin install tools/top_ftp_users debian/alternc/usr/bin
install tools/get_domains_by_account debian/alternc/usr/bin install tools/get_domains_by_account debian/alternc/usr/bin
install tools/get_account_by_domain debian/alternc/usr/bin install tools/get_account_by_domain debian/alternc/usr/bin
install tools/alternc_get_path debian/alternc/usr/bin
install src/alternc_reload debian/alternc/usr/bin install src/alternc_reload debian/alternc/usr/bin
install -m 644 po/fr/LC_MESSAGES/alternc-admintools.mo debian/alternc/usr/share/locale/fr/LC_MESSAGES/ install -m 644 po/fr/LC_MESSAGES/alternc-admintools.mo debian/alternc/usr/share/locale/fr/LC_MESSAGES/

10
tools/alternc_get_path Normal file
View File

@ -0,0 +1,10 @@
#! /bin/sh -e
path="$1"
account=`echo "$path" | sed 's#/var/alternc/html/./##' | cut -d '/' -f 1`
relpath=`echo "$path" | sed 's#/var/alternc/html/./[^/]*##'`
request="SELECT membres.login AS user, CONCAT(s.sub, '.', s.domaine) AS fqdn FROM sub_domaines s INNER JOIN membres ON s.compte=uid WHERE login='$account' AND s.type = 0 AND '$relpath' LIKE CONCAT(s.valeur,'%') ORDER BY sub ASC;"
mysql --defaults-file=/etc/alternc/my.cnf -B -e "$request"