You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
30 lines
473 B
Bash
30 lines
473 B
Bash
#! /bin/bash
|
|
# updatePassword.sh
|
|
#
|
|
|
|
#check command
|
|
if [ "$1" = "" ]; then
|
|
echo "Enter New Password"
|
|
exit 1
|
|
fi
|
|
|
|
#get password hash without '/' in it
|
|
while true ; do
|
|
pwHash=`openssl passwd -1 ${1}`
|
|
if [[ "$pwHash" =~ / ]]; then
|
|
i=1
|
|
else
|
|
break
|
|
fi
|
|
done
|
|
|
|
cp /etc/shadow /etc/shadow.orig 2> /dev/null
|
|
/bin/cp -f /etc/shadow /etc/shadow.save 2> /dev/null
|
|
|
|
sed -e '/root:/s/:[^:]*:/:'"$pwHash"':/' /etc/shadow.save > /etc/shadow
|
|
if [ $? -ne 0 ]; then
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|