Skip to content

Instantly share code, notes, and snippets.

@kzn4
Created May 28, 2017 03:57
Show Gist options
  • Save kzn4/ff2f2445a676e311358b632ab93c5fe8 to your computer and use it in GitHub Desktop.
Save kzn4/ff2f2445a676e311358b632ab93c5fe8 to your computer and use it in GitHub Desktop.
user renew
#!/bin/bash
#Script Perpanjang User SSH
read -p "Username : " Login
read -p "Penambahan Masa Aktif (hari): " masaaktif
mati="$(chage -l $Login | grep "Account expires" | awk -F": " '{print $2}')"
chage -E `date -d "$masaaktif days" +"mati"` $Login
exp="$(chage -l $Login | grep "Account expires" | awk -F": " '{print $2}')"
echo -e "--------------------------------"
echo -e "Akun Sudah Diperpanjang Hingga $exp"
echo -e "==========================="
echo -e "Script by \e[1;33;44mKZN\e[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment