]> gitweb.fluxo.info Git - hydra.git/commitdiff
Misc fixes and TODO update
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 30 Sep 2011 20:08:06 +0000 (17:08 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 30 Sep 2011 20:08:06 +0000 (17:08 -0300)
lib/hydra/misc
share/hydractl/backup-restore-site
share/hydractl/backup-site

index 98d16ac857ec97a27035ff69450ea9f365fe0fd6..77d610d00533a296cdd9e67763fc68b9610fcf23 100644 (file)
@@ -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
+}
index 04c0b10ea817579ca5ffac25668c51f30e0134d8..39353e981fc24f822828bf0456bdd45b7a0e80d7 100755 (executable)
@@ -3,6 +3,7 @@
 # Restore a website from backup
 #
 # TODO: moin
+# TODO: check for site user
 # TODO: support restoration from /var/sites/backups
 
 # Load.
index 856e69533daa2fed85d51487275020b113c50780..dedf0eb82baca19bbc4fb043cf115589bb781658 100755 (executable)
@@ -2,6 +2,7 @@
 #
 # Pack a website.
 #
+# TODO: check for backup user/group
 
 # Arguments
 SITES="/var/sites"