Skip to content

Instantly share code, notes, and snippets.

@rushipkar90
Created September 25, 2015 16:35
Show Gist options
  • Save rushipkar90/28ceac1c37a5ad498d32 to your computer and use it in GitHub Desktop.
Save rushipkar90/28ceac1c37a5ad498d32 to your computer and use it in GitHub Desktop.
forcepwchange.sh
#!/bin/sh
if [ $# -lt 1 ]; then
echo "No arguments supplied"
echo "usage: sh $0 <username>"
exit 1
fi
if [ ! -d /home/$1 ]; then
echo "User doesn't exist"
echo "usage: sh $0 <username>"
exit 1
fi
echo $1 > /home/$1/.cpanel/passwordforce
chown $1:$1 /home/$1/.cpanel/passwordforce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment