20 lines
459 B
Bash
Executable file
20 lines
459 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
if [[ -z ${1} ]]; then
|
|
printf 'File not provided!\n'
|
|
exit 1
|
|
fi
|
|
if [[ ! -f "${1}" ]]; then
|
|
printf 'File does not exist!\n'
|
|
exit 1
|
|
fi
|
|
if [[ "${1}" != *'.deb' ]]; then
|
|
printf 'File is not a deb!\n'
|
|
exit 1
|
|
fi
|
|
if ! ping -c 1 -w 10 server-dell-7050sff-debian &>/dev/null; then
|
|
printf 'Server inaccessible!\n'
|
|
exit 2
|
|
fi
|
|
printf 'Sending file to server: %s\n' "${1}"
|
|
scp "${1}" pogmom@server-dell-7050sff-debian:/home/pogmom/debs/
|