mirror of
https://github.com/pivpn/pivpn.git
synced 2025-05-06 07:54:10 +02:00
Use printf with column in the listCONF.sh script
This commit is contained in:
parent
4466f1503c
commit
cd1b8fbf7f
3 changed files with 10 additions and 8 deletions
|
@ -6,8 +6,9 @@ if [ ! -s clients.txt ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
{
|
||||
# Present the user with a summary of the clients, fetching info from dates.
|
||||
FORMATTED+=": \e[4mClient\e[0m&\e[4mCreation date\e[0m :\n"
|
||||
printf ": \e[4mClient\e[0m \t \e[4mCreation date\e[0m :\n"
|
||||
|
||||
while read -r LINE; do
|
||||
CLIENT_NAME="$(awk '{print $1}' <<< "$LINE")"
|
||||
|
@ -17,7 +18,8 @@ while read -r LINE; do
|
|||
# Dates are converted from UNIX time to human readable.
|
||||
CD_FORMAT="$(date -d @"$CREATION_DATE" +'%d %b %Y, %H:%M, %Z')"
|
||||
|
||||
FORMATTED+="• $CLIENT_NAME&$CD_FORMAT\n"
|
||||
printf "• $CLIENT_NAME \t $CD_FORMAT\n"
|
||||
done < clients.txt
|
||||
|
||||
echo -e "$FORMATTED" | column -t -s '&'
|
||||
printf "\n"
|
||||
} | column -t -s $'\t'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue