slitaz-forge rev 144

pangolin: add command adduser
author Christophe Lincoln <pankso@slitaz.org>
date Sat Mar 17 11:21:04 2012 +0100 (2012-03-17)
parents badc896c116d
children 71e17041ea14
files pangolin/pangolin
line diff
     1.1 --- a/pangolin/pangolin	Thu Mar 15 23:34:54 2012 +0100
     1.2 +++ b/pangolin/pangolin	Sat Mar 17 11:21:04 2012 +0100
     1.3 @@ -11,14 +11,20 @@
     1.4  WWW="/home/slitaz/www"
     1.5  WEBSITE="$WWW/website"
     1.6  PYTHON_LIB="/usr/lib/python2.5"
     1.7 +HGUSERS="/home/slitaz/auth/hgusers"
     1.8  
     1.9  usage() {
    1.10 -	echo "Usage: $(basename $0) [command]
    1.11 +	cat << EOT
    1.12 +
    1.13 +Usage: $(basename $0) [command]
    1.14  Commands:
    1.15    up-www       Update website http://www.slitaz.org/
    1.16    up-hg        Update Hg web interface http://hg.slitaz.org/
    1.17 +  adduser      Add a user to Hg
    1.18    stats        Display some server stats.
    1.19 -  backup       Backup MySQL DB and files"
    1.20 +  backup       Backup MySQL DB and files
    1.21 +
    1.22 +EOT
    1.23  }
    1.24  
    1.25  case "$1" in
    1.26 @@ -33,6 +39,10 @@
    1.27  		cp -a slitaz-mercurial-style/* $PYTHON_LIB/site-packages/mercurial
    1.28  		chown -R root.root $PYTHON_LIB/site-packages/mercurial/templates
    1.29  		echo "" ;;
    1.30 +	adduser)
    1.31 +		[ ! "$2" ] && echo "Missing user name arg" && exit 0
    1.32 +		[ ! "$3" ] && echo "Missing password arg" && exit 0
    1.33 +		htpasswd -b $HGUSERS $2 $3 ;;
    1.34  	stats)
    1.35  		# Echo some stats.
    1.36  		echo "======== Disk usage ============="