From 26b870284b96f4dfd7132ef0ce8fdcfdd385446c Mon Sep 17 00:00:00 2001 From: christian-byrne Date: Thu, 19 Sep 2024 22:51:20 -0700 Subject: [PATCH] Add lectura automation sripts --- .example.env | 2 ++ .gitignore | 1 + connect-lectura | 20 ++++++++++++++++++++ install | 0 start-wiki | 0 submit-lectura | 25 +++++++++++++++++++++++++ test-compile | 0 7 files changed, 48 insertions(+) create mode 100644 .example.env create mode 100755 connect-lectura mode change 100644 => 100755 install mode change 100644 => 100755 start-wiki create mode 100755 submit-lectura mode change 100644 => 100755 test-compile diff --git a/.example.env b/.example.env new file mode 100644 index 0000000..f8c9426 --- /dev/null +++ b/.example.env @@ -0,0 +1,2 @@ +UA_NET_ID=your_net_id # first initial + last name +LECTURA_PASSWORD=your_password \ No newline at end of file diff --git a/.gitignore b/.gitignore index 28a4c54..12949b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.env tests/**/skip*.sm* **repo-link.txt diff --git a/connect-lectura b/connect-lectura new file mode 100755 index 0000000..edae70a --- /dev/null +++ b/connect-lectura @@ -0,0 +1,20 @@ +#!/bin/bash + +source ./.env + +if [ -z $UA_NET_ID ]; then + echo "Set UA_NET_ID in .env" + exit 1 +fi + +if [ -z $LECTURA_PASSWORD ]; then + echo "Set LECTURA_PASSWORD in .env" + exit 1 +fi + +# Copy lectura password to clipboard +echo $LECTURA_PASSWORD | clipboard + +echo -e "\nPassword copied to clipboard" +echo "Connecting to lectura..." +ssh $UA_NET_ID@lectura.cs.arizona.edu \ No newline at end of file diff --git a/install b/install old mode 100644 new mode 100755 diff --git a/start-wiki b/start-wiki old mode 100644 new mode 100755 diff --git a/submit-lectura b/submit-lectura new file mode 100755 index 0000000..56869df --- /dev/null +++ b/submit-lectura @@ -0,0 +1,25 @@ +#!/bin/bash + +source ./.env + +if [ -z $1 ]; then + echo "No file provided" + exit 1 +fi + +if [ ! -f $1 ]; then + echo "File does not exist" + exit 1 +fi + +if [ -z $LECTURA_PASSWORD ]; then + echo "Set LECTURA_PASSWORD in .env" + exit 1 +fi + +# Copy lectura password to clipboard +echo $LECTURA_PASSWORD | clipboard + +echo -e "\nPassword copied to clipboard" + +scp $1 $UA_NET_ID@lectura.cs.arizona.edu:~/submit-lectura \ No newline at end of file diff --git a/test-compile b/test-compile old mode 100644 new mode 100755