#!/bin/bash

[ -z "$1" ] && {
    echo "usage: $0 http://.../project.repo" >&2
    echo "transforms last part of the path to a sane filename" >&2
    echo "and saves it to /etc/zypp/repo.d" >&2
    exit 1
}

url=$1
fname=$(basename "$1" | tr ":" "_")

wget "$1" -O "/etc/zypp/repos.d/$fname"

