manjaro-tools/bin/deployiso.in

96 lines
2.2 KiB
Text
Raw Normal View History

#!/bin/bash
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
version=@version@
LIBDIR='@libdir@'
SYSCONFDIR='@sysconfdir@'
[[ -r ${LIBDIR}/util-msg.sh ]] && source ${LIBDIR}/util-msg.sh
import ${LIBDIR}/util.sh
2015-11-12 19:03:51 +01:00
import ${LIBDIR}/util-publish.sh
display_settings(){
show_version
show_config
2015-11-12 00:31:51 +01:00
2015-11-12 12:25:35 +01:00
msg "ARGS:"
msg2 "publish: ${publish}"
msg2 "is_sf: ${is_sf}"
2015-11-12 00:31:51 +01:00
msg "HOST:"
msg2 "cache_dir_iso: ${cache_dir_iso}"
2015-11-12 12:25:35 +01:00
msg2 "dist_release: ${dist_release}"
2015-11-12 00:31:51 +01:00
msg "REMOTE:"
msg2 "remote_url: ${remote_url}"
msg2 "remote_project: ${remote_project}"
msg2 "remote_target: ${remote_target}"
msg2 "remote_user: ${remote_user}"
msg2 "remote_pwd: ${remote_pwd}"
2015-11-12 17:49:38 +01:00
${is_sf} && msg2 "sf_url: ${sf_url}"
${is_sf} && msg2 "shell_url: ${shell_url}"
}
load_user_info
load_config "${USER_CONFIG}/manjaro-tools.conf"
load_config "${SYSCONFDIR}/manjaro-tools.conf"
2015-11-12 00:31:51 +01:00
publish=false
pretend=false
2015-11-12 12:25:35 +01:00
is_sf=false
[[ ${remote_url} == 'sourceforge.net' ]] && is_sf=true
usage() {
echo "Usage: ${0##*/} [options]"
echo ' -u Upload iso file(s)'
2015-11-12 17:49:38 +01:00
echo ' -q Query settings and pretend upload'
echo ' -h This help'
echo ''
echo ''
exit $1
}
orig_argv=("$@")
2015-11-12 12:25:35 +01:00
opts=':uqh'
while getopts "${opts}" arg; do
case "${arg}" in
2015-11-12 12:25:35 +01:00
u) publish=true ;;
q) pretend=true ;;
h|?) usage 0 ;;
*) echo "invalid argument '${arg}'"; usage 1 ;;
esac
done
shift $(($OPTIND - 1))
timer_start=$(get_timer)
2015-11-12 17:49:38 +01:00
cache_dir_iso="${cache_dir}/iso"
2015-11-12 12:25:35 +01:00
2015-11-12 17:49:38 +01:00
if ${is_sf};then
sf_url=${remote_user},${remote_project}@frs.${remote_url}:${remote_target}/${remote_project}
2015-11-12 19:03:51 +01:00
shell_url=${remote_user},${remote_project}@shell.${remote_url}
2015-11-12 17:49:38 +01:00
else
msg3 "Do something here if not sf"
fi
2015-11-12 12:25:35 +01:00
2015-11-12 00:31:51 +01:00
# check_root "$0" "${orig_argv[@]}"
${pretend} && display_settings && exit 1
${publish} && upload