-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase-script.sh
executable file
·58 lines (43 loc) · 1.53 KB
/
base-script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Notes
# Variables
# This stores script-name.sh inside the variable $SCRIPTNAME
SCRIPTNAME=`basename "$0"`
# Storing the full path and filename in a variable:
FULLSCRIPTPATH="`pwd`/$SCRIPTNAME"
# Functions
# Header
echo \
"###########################################
Script: $FULLSCRIPTPATH
Bash Version: $BASH_VERSION
Author: Ashley Cawley // @ashleycawley
############################################"
# Main Script
# Checks if the user supplied an arguement and if not it advises them on usage
if [ "$#" -ne 1 ]
then
echo "Error: Invalid Usage. Try again but this time specify a domain name:"
echo -e "Usage: [~]# migrate cloudabove.com"
exit 1
fi
# Prints Help information - Checks the first arguement $1 is not empty AND contains --help or -help
if [ ! -z "$1" ] && [ `echo $1` == '--help' ] || [ `echo $1` == '-help' ]
then
echo "
### $SCRIPTNAME - Help ###
---------------------------
## Usage
[user@server]# migrate domain.co.uk
-----------------------------------------------------------------------------------------------------------
## Title
More details notes
- Bullet 1.
- Bullet 2.
------------------------------------------------------------------------------------------------------------
## Additional Support
If you are still unsure or something is not behaving as it should then please feel free
to reach out to the author: Ashley Cawley // @ashleycawley // [email protected]
"
exit 0
fi