0,0 → 1,37 |
#!/bin/sh |
|
# |
# HostAdmiral backend. Executed with ROOT privileges |
# |
# The script deletes specified domain dir in mail spool |
# |
# Params: |
# domain (e.g. example.com) |
# |
# Return: |
# 0 - done |
# 3 - wrong params |
# 4 - some error |
# 5 - error from system |
# |
|
### config ################################################ |
|
. `dirname $0`/scripts.conf |
|
### validate params ####################################### |
|
if [ -z "$1" -o -n "$2" ] ; then echo "Wrong params 1"; exit 3; fi |
|
DIR="/$1/" |
echo "$DIR" | awk '$0 ~ "//" || $0 ~ "/\\./" || $0 ~ "/\\.\\./" || $0 !~ "^/(([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)\\.)*([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)/$" {exit 1} {exit 0}' |
if [ $? -ne 0 ]; then |
echo "Wrong params 2"; exit 3 |
fi |
|
### work ################################################## |
|
if [ -d "${ROOT}${DIR}" ] ; then |
rmdir "${ROOT}${DIR}" || { echo "Cannot delete domain dir"; exit 5; } |
fi |
|
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |