#! /bin/sh #---------------------------------------------------------------------------- # inet-list-vusers - list pure-ftpd virtual users # # Copyright (c) 2001-2005 Ansgar Püster # # Creation: 05.10.2003 ap # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- # include eislib . /var/install/include/eislib inet_config=/etc/config.d/inet . $inet_config header() { clrhome mecho -info "List pure-ftpd virtual users" mecho techo begin 3 22 50 techo row " " "Virtual User" "Home" } footer() { mecho mecho anykey } header if [ ! $FTP_ENABLE_VIRTUAL_USERS = 'yes' ]; then mecho mecho -error "pure-ftpd virtual users are not enabled, no users are listed" footer techo end exit fi tty=`tty` row=4 pure-pw list | while read line do set -- $line user="$1" home="$2" techo row " " $user $home row=`expr $row + 1` if [ $row = 21 ] then # read answer from stdin footer < $tty # to fool mecho stdin is redirected to the tty header < $tty row=4 fi done footer techo end