Advertisement
Guest User

Untitled

a guest
May 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.44 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. while read username group name surname; do
  4.     if [ -z $group ]; then
  5.         username_=$( echo $username | cut -d ',' -f1 )
  6.         group=$( echo $username | cut -d ',' -f2 )
  7.         username=$username_
  8.     else
  9.         username=$( echo $username | tr -d ':' )
  10.     fi
  11.    
  12.     #echo $username
  13.     #echo $group
  14.     #echo $name
  15.     #echo $surname
  16.  
  17.     # delete users
  18.     deluser --remove-home --quiet $username &> abc
  19.     delgroup --only-if-empty --quiet $group &> abc
  20. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement