Alternc  latest
Alternc logiel libre pour l'hébergement
mem_del
Go to the documentation of this file.
1 #!/bin/bash
2 
3 if [ $# -ne 2 ] ; then
4  echo "Usage: mem_del <name>"
5  echo " Delete the AlternC account <name>"
6  exit 1
7 fi
8 
9 name="$1"
10 
11 if [[ ! "$name" =~ ^([a-z0-9]+)$ ]] ; then
12  echo "Account name is incorrect."
13  exit 2
14 fi
15 
16 
17 if [[ ! "$(id -u)" == "0" ]] ; then
18  echo "please launch mem_del as root (or using sudo)"
19  exit 4
20 fi
21 
22 # Get the vars and some functions
23 source /usr/lib/alternc/functions.sh
24 target="$(get_html_path_by_name "$name")"
25 
26 test -d "$target" && rm -rf "$target"
27