mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-08 20:02:32 +01:00
r188@krups: intrigeri | 2005-10-03 01:14:37 +0200
Replaced awful "grep /etc/passwd" with getent calls in pgsql and mysql handlers
This commit is contained in:
parent
995e34e166
commit
1645c0c857
@ -22,7 +22,7 @@ if [ "$user" == "" ]; then
|
||||
user=root;
|
||||
else
|
||||
userset=true;
|
||||
userhome=`grep "^$user:" /etc/passwd | awk -F: '{print $6}'`
|
||||
userhome=`getent passwd "$user" | awk -F: '{print $6}'`
|
||||
[ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
|
||||
fi
|
||||
|
||||
|
@ -58,7 +58,7 @@ fi
|
||||
|
||||
# give backup dir the good uid and permissions
|
||||
# (in respect to the vserver, if $usevserver)
|
||||
pguid=`grep '^postgres:' $vroot/etc/passwd | awk -F: '{print $3}'`
|
||||
pguid=`getent passwd postgres | awk -F: '{print $3}'`
|
||||
[ -n "$pguid" ] || \
|
||||
fatal "No user called postgres`[ $usevserver != 1 ] || echo \" on vserver $vsname\"`."
|
||||
debug "chown $pguid $vroot$backupdir"
|
||||
|
Loading…
Reference in New Issue
Block a user