fixed amgmt user creation
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Paolo Asperti 2019-05-09 17:37:53 +02:00
parent 4d7087e7ca
commit 78d062c019
Signed by: paspo
GPG Key ID: 06D46905D19D5182

View File

@ -47,7 +47,16 @@ mkdir -p %{buildroot}%{_localstatedir}/cache/client-manager
%defattr(-,root,root) %defattr(-,root,root)
%pre %pre
/usr/bin/getent passwd amgmt || /usr/sbin/useradd -r -g wheel -d /home/amgmt -s /sbin/nologin amgmt /usr/bin/getent passwd amgmt || /usr/sbin/useradd -r -m -g wheel -d /home/amgmt -s /sbin/nologin amgmt
if [ ! -d /home/amgmt/.ssh ] ; then
mkdir -p /home/amgmt/.ssh
fi
chmod 0700 /home/amgmt /home/amgmt/.ssh
chown -R amgmt:wheel /home/amgmt
if [ ! -f /home/amgmt/.ssh/id_rsa ] ; then
cat /dev/zero | sudo -u amgmt ssh-keygen -q -N ""
fi
if [ "$1" = 2 ]; then if [ "$1" = 2 ]; then
#upgrade #upgrade
/usr/bin/systemctl stop client-manager >/dev/null 2>&1 || : /usr/bin/systemctl stop client-manager >/dev/null 2>&1 || :