Built and tested basic structure of the source of debmirrorman, added build.sh for building the source into a single executable file from the individual .sh and .lib.sh files.
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
|
||||
TITLE="DebMirror Manager"
|
||||
VERSION="0.0.1"
|
||||
URL="https://git.3volve.net.za/thisiszeev/debmirrorman"
|
||||
AUTHOR="Ze'ev Schurmann"
|
||||
AUTHORURL="https://reddit.com/u/thisiszeev"
|
||||
|
||||
source vars.lib.sh
|
||||
source functions.lib.sh
|
||||
source actions.lib.sh
|
||||
|
||||
if [[ -z "${1}" ]]; then
|
||||
doHelper
|
||||
exit
|
||||
else
|
||||
command="${1,,}"
|
||||
if [[ -z "${commands[${command}]}" ]]; then
|
||||
echo "Command ${1} not valid..."
|
||||
exit 1
|
||||
else
|
||||
if [[ -n "${2}" ]]; then
|
||||
if [[ "${commandsneedreponame[${command}]}" == "none" ]]; then
|
||||
echo "Command ${1} does not support a repo name..."
|
||||
exit 1
|
||||
elif [[ "${commandsneedreponame[${command}]}" == "help" ]]; then
|
||||
helpcommand="${2,,}"
|
||||
if [[ -z "${commands[${helpcommand}]}" ]]; then
|
||||
echo "Command ${2} not valid..."
|
||||
exit 1
|
||||
else
|
||||
if [[ -z "${helpercommands[${helpcommand}]}" ]]; then
|
||||
echo "No help documentation for command ${2}..."
|
||||
exit 1
|
||||
else
|
||||
${helpercommands[${helpcommand}]}
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if funcCheckLocalRepo "${2}"; then
|
||||
${commands[${command}]} "${2}"
|
||||
exit
|
||||
else
|
||||
echo "Invalid local repo name..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [[ "${commandsneedreponame[${command}]}" == "required" ]]; then
|
||||
echo "Command ${1} requires a repo name..."
|
||||
exit 1
|
||||
else
|
||||
${commands[${command}]}
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
exit 127
|
||||
|
||||
Reference in New Issue
Block a user