diff --git a/default/home/.local/bin/serverutil-deb-upload b/default/home/.local/bin/serverutil-deb-upload new file mode 100755 index 0000000..b435a0d --- /dev/null +++ b/default/home/.local/bin/serverutil-deb-upload @@ -0,0 +1,20 @@ +#!/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/ diff --git a/default/include b/default/include index 00fe11c..82d1e38 100644 --- a/default/include +++ b/default/include @@ -12,3 +12,4 @@ Scripts/iso_updater.sh .local/bin/rdict .config/fastfetch/config.jsonc Scripts/fix-swap-part.sh +.local/bin/serverutil-deb-upload