mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Setup Script - Change tmp location and delte key if its already there
This commit is contained in:
@@ -35,8 +35,27 @@ accept_salt_key_local() {
|
|||||||
|
|
||||||
accept_salt_key_remote() {
|
accept_salt_key_remote() {
|
||||||
|
|
||||||
|
# See if the key is already there. If so nuke it.
|
||||||
|
GETKEYSACCEPTED=$(ssh -v -i /root/.ssh/so.key socore@$MSRV sudo salt-key -l accepted)
|
||||||
|
GETKEYSREJECTED=$(ssh -v -i /root/.ssh/so.key socore@$MSRV sudo salt-key -l rejected)
|
||||||
|
|
||||||
|
if grep -q $HOSTNAME $GETKEYSACCEPTED; then
|
||||||
|
SKACPT=1
|
||||||
|
else
|
||||||
|
SKACPT=0
|
||||||
|
fi
|
||||||
|
if grep -q $HOSTNAME $GETKEYSREJECTED; then
|
||||||
|
SKRJCT=1
|
||||||
|
else
|
||||||
|
SKRJCT=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $SKACPT=1 ] || [ $SKRJCT=1 ]; then
|
||||||
|
ssh -v -i /root/.ssh/so.key socore@$MSRV sudo salt-key -d $HOSTNAME -y
|
||||||
|
else
|
||||||
# Accept the key remotely so the device can check in
|
# Accept the key remotely so the device can check in
|
||||||
ssh -v -i /root/.ssh/so.key socore@$MSRV sudo salt-key -a $HOSTNAME -y
|
ssh -v -i /root/.ssh/so.key socore@$MSRV sudo salt-key -a $HOSTNAME -y
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,15 +352,15 @@ got_root() {
|
|||||||
install_cleanup() {
|
install_cleanup() {
|
||||||
|
|
||||||
# Clean up after ourselves
|
# Clean up after ourselves
|
||||||
rm -rf ./installtmp
|
rm -rf /root/installtmp
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install_prep() {
|
install_prep() {
|
||||||
|
|
||||||
# Create a tmp space that isn't in /tmp
|
# Create a tmp space that isn't in /tmp
|
||||||
mkdir ./installtmp
|
mkdir /root/installtmp
|
||||||
TMP=./installtmp
|
TMP=/root/installtmp
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user