diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-09-30 17:08:06 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-09-30 17:08:06 -0300 |
commit | 4ebcd5202ed92a7c8df5f2e477e621f22bcda838 (patch) | |
tree | aace555db792084dd64be873796e2ce958d7ef12 | |
parent | e9f5bdb87407a30bebf10e7327531e8b0ad10964 (diff) | |
download | hydra-4ebcd5202ed92a7c8df5f2e477e621f22bcda838.tar.gz hydra-4ebcd5202ed92a7c8df5f2e477e621f22bcda838.tar.bz2 |
Misc fixes and TODO update
-rw-r--r-- | lib/hydra/misc | 20 | ||||
-rwxr-xr-x | share/hydractl/backup-restore-site | 1 | ||||
-rwxr-xr-x | share/hydractl/backup-site | 1 |
3 files changed, 19 insertions, 3 deletions
diff --git a/lib/hydra/misc b/lib/hydra/misc index 98d16ac..77d610d 100644 --- a/lib/hydra/misc +++ b/lib/hydra/misc @@ -17,12 +17,17 @@ function hydra_user_input { param="$1" default="$2" shift 2 - read -rep "$* (defaults to $default): " input + + if echo $param | grep -q 'passwd'; then + read -s -rep "$* (defaults to $default): " input + else + read -rep "$* (defaults to $default): " input + fi if [ -z "$input" ]; then - export $param=$default + export $param="$default" else - export $param=$input + export $param="$input" fi } @@ -57,3 +62,12 @@ function hydra_check_command { exit 1 fi } + +# Check for an user +function hydra_check_user { + if [ -z "$1" ]; then + return 1 + fi + + grep -qe "^$1:" /etc/passwd +} diff --git a/share/hydractl/backup-restore-site b/share/hydractl/backup-restore-site index 04c0b10..39353e9 100755 --- a/share/hydractl/backup-restore-site +++ b/share/hydractl/backup-restore-site @@ -3,6 +3,7 @@ # Restore a website from backup # # TODO: moin +# TODO: check for site user # TODO: support restoration from /var/sites/backups # Load. diff --git a/share/hydractl/backup-site b/share/hydractl/backup-site index 856e695..dedf0eb 100755 --- a/share/hydractl/backup-site +++ b/share/hydractl/backup-site @@ -2,6 +2,7 @@ # # Pack a website. # +# TODO: check for backup user/group # Arguments SITES="/var/sites" |