0,0 → 1,36 |
#!/bin/sh |
|
# |
# HostAdmiral backend. Executed with ROOT privileges |
# |
# The script deletes specified maildir |
# FIXME: do not delete - move to archive |
# |
# Params: |
# maildir (e.g. example.com/john) |
# |
# 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])?)/[a-zA-Z]([a-zA-Z0-9._-]*[a-zA-Z0-9])?/$" {exit 1} {exit 0}' |
if [ $? -ne 0 ]; then |
echo "Wrong params 2"; exit 3 |
fi |
|
### work ################################################## |
|
rm -rf "${ROOT}${DIR}" |
|
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |