feature: add connect command
This commit is contained in:
16
mc
16
mc
@@ -38,8 +38,21 @@ declare -rA commands=(
|
||||
[search]='search POST {"mod":"%s"}'
|
||||
[mod-list]='mod-list GET'
|
||||
[backup]='backup FUNC'
|
||||
[connect]='connect FUNC'
|
||||
)
|
||||
|
||||
function connect() {
|
||||
if [[ ! $(which docker) ]]; then echo "docker is required"; exit 1; fi
|
||||
docker run --rm \
|
||||
-e MODE=my-mc \
|
||||
-e PORT=25565 \
|
||||
-e HOST=0.0.0.0 \
|
||||
-e PUBLIC=false \
|
||||
-e MY_MC_API_KEY=$MY_MC_API_KEY \
|
||||
-p 25565:25565 anaxios/holesail:testing
|
||||
echo ""
|
||||
}
|
||||
|
||||
function backup() {
|
||||
if [[ ! $(which lftp) ]]; then echo "lftp is required"; exit 1; fi
|
||||
|
||||
@@ -59,7 +72,8 @@ function backup() {
|
||||
|
||||
pushd "${localdir}"
|
||||
|
||||
lftp -u "${username}","${password}" "${host}":"${port}" -e "set sftp:connect-program 'ssh -o StrictHostKeyChecking=no'; mirror -c --use-pget minecraft/ minecraft/; quit"
|
||||
lftp -u "${username}","${password}" "${host}":"${port}" \
|
||||
-e "set sftp:connect-program 'ssh -o StrictHostKeyChecking=no'; mirror -c --use-pget minecraft/ minecraft/; quit"
|
||||
|
||||
popd
|
||||
}
|
||||
|
Reference in New Issue
Block a user