Added many, many more actions.
This commit is contained in:
29
unity/unity-command/scripts/activate_license.sh
Normal file
29
unity/unity-command/scripts/activate_license.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
SERIAL=$1; USERNAME=$2; PASSWORD=$3;
|
||||
|
||||
function check_path
|
||||
{
|
||||
local SECRET_PATH="/run/secrets"
|
||||
local ENV_NAME="$1"
|
||||
local ENV_VALUE="${!ENV_NAME}"
|
||||
|
||||
local FILE_PATH="$SECRET_PATH/$ENV_NAME"
|
||||
if [[ -z "$ENV_VALUE" && -f "$FILE_PATH" ]]; then
|
||||
export $ENV_NAME=$(cat "$FILE_PATH")
|
||||
fi
|
||||
}
|
||||
|
||||
check_path SERIAL
|
||||
check_path USERNAME
|
||||
check_path PASSWORD
|
||||
|
||||
if [[ -z "$SERIAL" || -z "$USERNAME" || -z "$PASSWORD" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#Activate Unity
|
||||
if [[ "$SERIAL" == "personal" ]]; then
|
||||
UnityBuilder activate -i /usr/bin/unity-editor -u $USERNAME -p $PASSWORD
|
||||
else
|
||||
unity-editor $DEFAULT_ARGS -serial $SERIAL -username $USERNAME -password $PASSWORD
|
||||
fi
|
||||
17
unity/unity-command/scripts/add_ssh_keys.sh
Normal file
17
unity/unity-command/scripts/add_ssh_keys.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
if [[ -n "$SSH_PUBLIC_KEY" && -n "$SSH_PRIVATE_KEY" ]]; then
|
||||
echo "ADDING SSH KEYS!"
|
||||
SSH_DIR="/home/$(whoami)/.ssh"
|
||||
mkdir -p $SSH_DIR
|
||||
|
||||
echo "$SSH_PUBLIC_KEY" > $SSH_DIR/id_rsa.pub
|
||||
echo "$SSH_PRIVATE_KEY" > $SSH_DIR/id_rsa
|
||||
cat << EOF > $SSH_DIR/config
|
||||
Host *
|
||||
StrictHostKeyChecking no
|
||||
EOF
|
||||
|
||||
chmod 600 $SSH_DIR/id_rsa
|
||||
chmod 644 $SSH_DIR/id_rsa.pub
|
||||
cat $SSH_DIR/config
|
||||
fi
|
||||
Reference in New Issue
Block a user