-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathboa
executable file
·38 lines (28 loc) · 1.14 KB
/
boa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/sh
# boa mk stable
# echo "deb [trusted=yes] https://repo.nxos.org stable" >> /etc/apt/sources.list
cp () {
r="$1"; shift
tmp=`ssh "$remote" mktemp -d`
scp "$@" "$remote:$tmp" || return $?
for p in "$@"; do set -- "$@" "$tmp/${p##*/}"; shift; done
ssh "$remote" reptile cp "$r" "$@"
ssh "$remote" rm -rf "$tmp"
}
[ $# -gt 0 ] && remote="$1" && shift
case "$1" in
cp ) "$@";;
mk | mv | rm | ls ) ssh "$remote" reptile "$@";;
* )
echo "Usage: boa <remote> <command [args]>"
echo ""
echo "command is any of:"
echo ""
echo " mk <repos> Create new repositories."
echo " cp <repo> <pkgs> Add packages to a repository."
echo " rm <repo> [pkgs] Remove a repository or package that belongs to a repository."
echo " mv <pkg> <from> <to> Move a package from a repository to another."
echo " mv <old> <new> Rename a repository."
echo " ls [repo] [pkg] List the contents of a repository or a package. If no"
echo " arguments are provided, list all repositories.";;
esac