# HG changeset patch # User Christophe Lincoln # Date 1301522706 -7200 # Node ID 1e164894a3eda5eb7e6fd3802a25b9b8b475b0dc # Parent f9644aebc4a8e0821433d058c9539fcdedeb85fc taztank: add command adduser to create new users on tank diff -r f9644aebc4a8 -r 1e164894a3ed tank/taztank --- a/tank/taztank Wed Mar 30 23:12:37 2011 +0200 +++ b/tank/taztank Thu Mar 31 00:05:06 2011 +0200 @@ -126,6 +126,59 @@ /var/www/cgi-bin/awstats.pl -config=$vh.slitaz.org done echo "" ;; + adduser|-au) + # On Tank /etc/skel is empty to let taktank handle default user + # files. + echo "" + if [ -n "$2" ]; then + user=$2 + else + echo -n "User name: " && read user + fi + if [ -d /home/$user ]; then + echo -e "User $user already exist...\n" && exit 1 + fi + echo "Adding user: $user" + adduser $user + # HG access + echo -n "Hg password: " && read passwd + echo "$user:$passwd" >> /etc/lighttpd/plain.passwd + # README + echo -n "Creating default user files... " + cat > /home/$user/README << EOF +Welcome to Tank! +================================================================================ + +Your Public directory URL is: http://people.slitaz.org/~$USER/ + +Please complet your public profile in ~/Public/profile.php and feel free +to use the service for your needs, if any thing goes wrong or is missing +please express your self :-) + +EOF + # Public profile + mkdir -p /home/$user/Public + cat > /home/$user/Public/profile.php << EOF + +EOF + # Shell profile + cat > /home/$user/.profile << EOF +# ~/.profile: Executed by Bourne-compatible login SHells. +# +EOF + echo -e "Done\n" ;; *) usage ;; esac