mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-27 15:33:55 +01:00
upload.sh: Add method directory
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
b79d89f37d
commit
84326720ec
1 changed files with 26 additions and 5 deletions
|
|
@ -34,7 +34,7 @@ HOST=ftp.jannet.de
|
||||||
CFG_FILE=$HOME/.uploadrc
|
CFG_FILE=$HOME/.uploadrc
|
||||||
|
|
||||||
login=`whoami`
|
login=`whoami`
|
||||||
method=rsync_ssh
|
method=
|
||||||
pw_ftp=
|
pw_ftp=
|
||||||
pw_scp=$HOME/.ssh/identity
|
pw_scp=$HOME/.ssh/identity
|
||||||
pw_rsync=
|
pw_rsync=
|
||||||
|
|
@ -149,13 +149,22 @@ parse_target()
|
||||||
echo pw_rsync_ssh="\"$PASSWD\";"
|
echo pw_rsync_ssh="\"$PASSWD\";"
|
||||||
fi
|
fi
|
||||||
HOST=`echo $target | sed -e 's/^.*:\/\///; s/.*@//' | cut -d: -f1`
|
HOST=`echo $target | sed -e 's/^.*:\/\///; s/.*@//' | cut -d: -f1`
|
||||||
if [ -n "$HOST" ]; then
|
case $METHOD in
|
||||||
echo host="\"$HOST\";"
|
rsync_ssh)
|
||||||
else
|
if [ -z "$HOST" ]; then
|
||||||
PARSE_TARGET=FALSE
|
PARSE_TARGET=FALSE
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
TARGET_FILE=`echo $target | sed -e 's/^.*:\/\///; s/.*@//; /:/ !d' | cut -d: -f2`
|
echo host="\"$HOST\";"
|
||||||
|
;;
|
||||||
|
"")
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
PARSE_TARGET=FALSE
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
TARGET_FILE=`echo $target | sed -e 's/^.*:\/\///; s/.*@//' | cut -d: -f2`
|
||||||
if [ -n "$TARGET_FILE" ]; then
|
if [ -n "$TARGET_FILE" ]; then
|
||||||
echo target_file="\"$TARGET_FILE\";"
|
echo target_file="\"$TARGET_FILE\";"
|
||||||
else
|
else
|
||||||
|
|
@ -287,6 +296,8 @@ rsync_ssh)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
"")
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
fatal "Support for method \"$method\" is not implemented." >&2
|
fatal "Support for method \"$method\" is not implemented." >&2
|
||||||
;;
|
;;
|
||||||
|
|
@ -334,6 +345,16 @@ rsync_ssh)
|
||||||
ssh_chown $target_path $file_owner $file_group
|
ssh_chown $target_path $file_owner $file_group
|
||||||
ssh_chmod $target_path $file_mode $dir_mode
|
ssh_chmod $target_path $file_mode $dir_mode
|
||||||
;;
|
;;
|
||||||
|
"")
|
||||||
|
#[ "$file_owner" ] || file_owner=`stat -c %u $source | head -1`
|
||||||
|
#[ "$file_group" ] || file_group=`stat -c %g $source | head -1`
|
||||||
|
#[ "$file_mode" ] || file_mode=`stat -c %a $source | head -1`
|
||||||
|
#install -m $file_mode -o $file_owner -g $file_group $source $target
|
||||||
|
$do_sudo cp $source $target
|
||||||
|
if [ "$file_owner" ] ; then $do_sudo chown $file_owner $target; fi
|
||||||
|
if [ "$file_group" ] ; then $do_sudo chgrp $file_group $target; fi
|
||||||
|
if [ "$file_mode" ] ; then $do_sudo chmod $file_mode $target; fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
fatal "Internal error: \"$method\" is not implemented." >&2
|
fatal "Internal error: \"$method\" is not implemented." >&2
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue