Compare commits

...

2 Commits

Author SHA1 Message Date
Paolo Asperti 89758cb050
version bump
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2020-03-08 10:27:25 +01:00
Paolo Asperti 7fadae6fe6
fix for re-adoption 2020-03-07 23:46:52 +01:00
3 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
Summary: LibreSchool Client Manager
Name: libreschool-client-manager
Version: 1.0.2
Version: 1.0.3
Release: 1.ns7
License: GPL
BuildArch: noarch
@ -97,6 +97,9 @@ if [ "$1" = 0 ]; then
fi
%changelog
* Sun Mar 8 2020 Paolo Asperti <paolo@asoerti.com> - 1.0.3-1.ns7
- fix re-adoption
* Sat Mar 7 2020 Paolo Asperti <paolo@asoerti.com> - 1.0.2-1.ns7
- fix re-adoption
- added some required packages

View File

@ -17,6 +17,8 @@ ping -c1 "$HOST" >/dev/null || (
exit 1
)
ssh-keygen -R "${HOST}"
sshpass -p "${PASS}" ssh -t -o StrictHostKeyChecking=no "${USER}@${HOST}" "whoami" || (
echo "Can't login to $HOST as $USER"
exit 1
@ -35,7 +37,6 @@ if [[ "$AMIROOT" = "" ]]; then
fi
PUB=$(db configuration getprop client-manager ManagementKeyFile)
ssh-keygen -R "${HOST}"
cat $PUB | \
sshpass -p "${PASS}" ssh -t -o StrictHostKeyChecking=no "${USER}@${HOST}" "echo '${PASS}' | sudo -S mkdir /root/.ssh >/dev/null ; sudo tee -a /root/.ssh/authorized_keys"

1
root/usr/bin/client-shell Normal file → Executable file
View File

@ -13,4 +13,5 @@ if [ "$USER" = "" ] ; then
exit 1
fi
/usr/bin/sudo -u amgmt ssh-keygen -R "${1}"
/usr/bin/sudo -u amgmt /usr/bin/ssh -o StrictHostKeyChecking=no ${USER}\@${1} ${@:2}