mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
* Erste Version des Pakfire von Peter git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@127 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
58 lines
980 B
Bash
58 lines
980 B
Bash
#!/bin/bash
|
|
############################################################################################
|
|
# Version 0.1a, Copyright (C) 2006 Peter Schaelchli Für IPFire besteht KEINERLEI GARANTIE;#
|
|
# IPFire ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen; #
|
|
############################################################################################
|
|
|
|
protokoll=${1%%:*}
|
|
|
|
rest=${1#*'//'}
|
|
|
|
if grep @ <<EOF >/dev/null
|
|
$rest
|
|
EOF
|
|
then
|
|
# User heraus suchen
|
|
user=${rest%%:*}
|
|
rest=${rest#*:}
|
|
pass=${rest%%@*}
|
|
rest=${rest#*@}
|
|
fi
|
|
|
|
host=${rest%%/*}
|
|
rest=${rest#*/}
|
|
|
|
if grep / <<EOF >/dev/null
|
|
$rest
|
|
EOF
|
|
then
|
|
dir=${rest%/*}
|
|
rest=${rest##*/}
|
|
fi
|
|
|
|
file=$rest
|
|
|
|
case "$2" in
|
|
get_proto)
|
|
echo $protokoll
|
|
;;
|
|
get_user)
|
|
echo $user
|
|
;;
|
|
get_pass)
|
|
echo $pass
|
|
;;
|
|
get_host)
|
|
echo $host
|
|
;;
|
|
get_dir)
|
|
echo $dir
|
|
;;
|
|
get_file)
|
|
echo $file
|
|
;;
|
|
*) exit 1
|
|
esac
|
|
|
|
################################### EOF ####################################################
|