-
Notifications
You must be signed in to change notification settings - Fork 0
/
renew.sh
44 lines (44 loc) · 1.37 KB
/
renew.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Script Created By 24clanSSH.Com
clear
echo -e ""
echo -e "======================================"
echo -e ""
echo -e " Script Created By 24clanSSH.Com "
echo -e ""
echo -e "======================================"
read -p " Username : " User
egrep "^$User" /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
read -p " Day Extend : " Days
Today=`date +%s`
Days_Detailed=$(( $Days * 86400 ))
Expire_On=$(($Today + $Days_Detailed))
Expiration=$(date -u --date="1970-01-01 $Expire_On sec GMT" +%Y/%m/%d)
Expiration_Display=$(date -u --date="1970-01-01 $Expire_On sec GMT" '+%d %b %Y')
passwd -u $User
usermod -e $Expiration $User
egrep "^$User" /etc/passwd >/dev/null
echo -e "$Pass\n$Pass\n"|passwd $User &> /dev/null
clear
echo -e ""
echo -e "========================================"
echo -e ""
echo -e " Script Created By 24clanSSH.Com "
echo -e ""
echo -e " Username : $User"
echo -e " Days Added : $Days Days"
echo -e " Expires on : $Expiration_Display"
echo -e ""
echo -e "========================================"
else
clear
echo -e ""
echo -e "========================================"
echo -e ""
echo -e " Script Created By 24clanSSH.Com "
echo -e ""
echo -e " Username Doesnt Exist "
echo -e ""
echo -e "========================================"
fi