Commit f7004a0f authored by Antoine Beaupré's avatar Antoine Beaupré

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

parent b5b69d9a
......@@ -439,6 +439,7 @@ src/update_domains.sh -text
tests/mechdump.pm -text
tests/test_demo.pl -text
tests/whois_test.php -text
tools/alternc_get_path -text
tools/get_account_by_domain -text
tools/get_domains_by_account -text
tools/top_ftp_users -text
......
......@@ -74,6 +74,7 @@ install: build
install tools/top_ftp_users 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/alternc_get_path 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/
......
#! /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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment