-
Notifications
You must be signed in to change notification settings - Fork 0
/
flow
executable file
·43 lines (42 loc) · 909 Bytes
/
flow
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
39
40
41
42
43
#!/bin/sh
do_install(){
if [ ! -d $2/etc/flow/ ];then
mkdir -p $2/etc/flow/
echo "Creating $2/etc/flow"
fi
echo "Installing $1"
. $1
cp $1 $2/etc/flow/$NAME
install_package $2/
}
do_remove(){
if [ -e $2/etc/flow/$1 ];then
. $2/etc/flow/$1
remove_package $2/
rm $2/etc/flow/$NAME
fi
}
do_help(){
echo "flow install <package> [root] TO INSTALL PACKAGE"
echo "flow remove <package> [root] TO REMOVE PACKAGE"
echo "flow help TO PRINT THIS HELP MESSAGE"
}
if [ $UID -ne 0 ];then
echo "Flow Package Manager Only Run In Root Account."
exit 0
fi
if [ -n "$1" ];then
if [ "$1" = "install" ];then
do_install $2 $3
exit 0
fi
if [ "$1" = "remove" ];then
do_remove $2 $3
exit 0
fi
if [ "$1" = "help" ];then
do_help
exit 0
fi
echo "Args are illegal."
fi