Compare commits
10
Commits
ea65984527
...
69f76dd54e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69f76dd54e | ||
|
|
276a6223a3 | ||
|
|
92d9e3fa1a | ||
|
|
526efc2255 | ||
|
|
d81053d31c | ||
|
|
2d965f8f2c | ||
|
|
62c0060617 | ||
|
|
0c798d9dc7 | ||
|
|
ff6ee95815 | ||
|
|
2d5302f56d |
No files matched your search
@@ -1,2 +1,11 @@
|
||||
# bash_scripts
|
||||
A collection of Bash Scripts
|
||||
### diffweb.sh
|
||||
`Checks a website for changes.`
|
||||
|
||||
### rotate.sh
|
||||
`Rotate a screen in Linux.`
|
||||
|
||||
### uapay.sh
|
||||
`A command-line interface to UofA employee payroll data.`
|
||||
|
||||
### crex.sh
|
||||
`Query a domain name's creation date and expiration date.`
|
||||
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# Description: Query Domain Name Creation and Expiration dates.
|
||||
# Usage: crex.sh <domain.tld>
|
||||
# Author: Justin Oros
|
||||
# Source: https://github.com/JustinOros
|
||||
|
||||
# Dependency Checks
|
||||
TARGET_FILE='/usr/bin/whois'
|
||||
if [ ! -f "$TARGET_FILE" ]
|
||||
then
|
||||
echo "$TARGET_FILE does not exist."
|
||||
exit
|
||||
fi
|
||||
|
||||
TARGET_FILE='/usr/bin/grep'
|
||||
if [ ! -f "$TARGET_FILE" ]
|
||||
then
|
||||
echo "$TARGET_FILE does not exist."
|
||||
exit
|
||||
fi
|
||||
|
||||
TARGET_FILE='/usr/bin/awk'
|
||||
if [ ! -f "$TARGET_FILE" ]
|
||||
then
|
||||
echo "$TARGET_FILE does not exist."
|
||||
exit
|
||||
fi
|
||||
|
||||
TARGET_FILE='/usr/bin/head'
|
||||
if [ ! -f "$TARGET_FILE" ]
|
||||
then
|
||||
echo "$TARGET_FILE does not exist."
|
||||
exit
|
||||
fi
|
||||
|
||||
# User Input
|
||||
DOMAIN_NAME=$1
|
||||
|
||||
# Get Creation Date
|
||||
CREATION_DATE=$(whois $DOMAIN_NAME | grep 'Creation' | awk '{print $3;}' | head -n 1)
|
||||
|
||||
# Get Expiration Date
|
||||
EXPIRATION_DATE=$(whois $DOMAIN_NAME | grep 'Expiration' | awk '{print $5;}')
|
||||
|
||||
# Output Results
|
||||
echo '-'
|
||||
echo 'Domain:' $DOMAIN_NAME
|
||||
echo 'Creation:' $CREATION_DATE
|
||||
echo 'Expiration:' $EXPIRATION_DATE
|
||||
echo '-'
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# rotate all screens clockwise in a complete circle
|
||||
# by Justin Oros
|
||||
# Description: Rotate screen clockwise in a complete circle
|
||||
# Usage: rotate.sh
|
||||
# Author: Justin Oros
|
||||
# Source: https://github.com/JustinOros
|
||||
|
||||
screen_types="VGA HDMI DP eDP"
|
||||
screen_rotations="right inverted left normal"
|
||||
@@ -18,7 +19,7 @@ rotate() {
|
||||
do
|
||||
for screen in 0 .. $screens
|
||||
do
|
||||
xrandr --output $screen_type-$screen --rotate $screen_rotation > /dev/null 2>&1
|
||||
xrandr -o $screen_rotation > /dev/null 2>&1
|
||||
done
|
||||
done
|
||||
sleep $sleep_time
|
||||
|
||||
@@ -1,59 +1,62 @@
|
||||
#!/bin/bash
|
||||
#################################################
|
||||
# Query Univeristy of Arizona payroll information
|
||||
# Written by Justin Oros
|
||||
# Usage: uapay.sh FirstName LastName
|
||||
#################################################
|
||||
# Description: Query UofA employee payroll data via CLI
|
||||
# Usage: uapay.sh <first name> <last name>
|
||||
# Author: Justin Oros
|
||||
# Source: https://github.com/JustinOros
|
||||
|
||||
# Check to see if BASH is installed
|
||||
{
|
||||
# BASH present?
|
||||
if [ ! -f /bin/bash ]; then
|
||||
echo "Bash not found!"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Check to see if CURL is installed
|
||||
{
|
||||
# CURL present?
|
||||
if [ ! -f /usr/bin/curl ]; then
|
||||
echo "Curl not found!"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Check to see if GREP is intalled
|
||||
{
|
||||
# GREP present?
|
||||
if [ ! -f /usr/bin/grep ]; then
|
||||
echo "Grep not found!"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
# URL for UA Salaries
|
||||
# UA Payroll URL
|
||||
uapay_url='https://openpayrolls.com/employee'
|
||||
|
||||
# User Agent
|
||||
uapay_useragent='Chrome/79'
|
||||
|
||||
# Get Input from User
|
||||
{
|
||||
# Get Input
|
||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||
echo -e "\nUsage: uapay.sh FirstName LastName\n"
|
||||
exit 0
|
||||
else
|
||||
uapay_name=$1-$2
|
||||
for i in "$@"
|
||||
do
|
||||
uapay_name="$@"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# Format Input
|
||||
uapay_formatted_name=${uapay_name// /-}-4329
|
||||
|
||||
# Grep Filter
|
||||
uapay_filter="and a pay of"
|
||||
|
||||
# Query URL
|
||||
uapay_output=$(curl -s -k --user-agent $uapay_useragent $uapay_url/$uapay_name-4329 | grep "$uapay_filter")
|
||||
uapay_query=$(curl -s -k --user-agent $uapay_useragent $uapay_url/$uapay_formatted_name | grep "$uapay_filter")
|
||||
|
||||
# Format output
|
||||
#echo ${uapay_output/<\/p>/}
|
||||
uapay_output=${uapay_output/\<p class=\"lead font-16 font-weight-400\"\>/}
|
||||
uapay_output=${uapay_output/\<\/p\>/}
|
||||
# Check Results
|
||||
if [ -z "$uapay_query" ]; then
|
||||
echo -e "\n$uapay_name was not found.\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -e "\n$uapay_output\n"
|
||||
# Format Output
|
||||
uapay_query=${uapay_query/\<p class=\"lead font-16 font-weight-400\"\>/}
|
||||
uapay_query=${uapay_query/\<\/p\>/}
|
||||
|
||||
# Print Output
|
||||
echo -e "\n$uapay_query\n"
|
||||
Reference in new issue
Block a user