Skip to content

Commit

Permalink
Create ptsadd
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Sep 11, 2019
1 parent 275cc71 commit a8b96a1
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions menu/alias/templates/ptsadd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
##usercheck
if [ $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}') ]; then
usermod -aG sudo $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}')
sudo usermod -s /bin/bash $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}')
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo " ✅ PASSED ! We found the user UID " $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}')
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
else
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo " ⌛ INFO ! "
echo " ⌛ INFO ! Only lowercase and dont empty parts"
echo " ⌛ INFO ! Enter a password (8+ chars)"
echo " ⌛ INFO ! "
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
read -p "Enter username : " username
read -s -p "Enter password : " password
echo ""
egrep "^$username" /etc/passwd >/dev/null
pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
useradd -m -p $pass $username
usermod -aG sudo $username
sudo usermod -s /bin/bash $username
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo " ✅ PASSED ! User has been added to system!"
echo " ✅ PASSED ! Your Username : " $username
echo " ✅ PASSED ! Your Password : " $password
echo " ✅ PASSED ! "
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
😂 What a Lame name: $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}')
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
exit 0

0 comments on commit a8b96a1

Please sign in to comment.