forked from denora/denora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-script
42 lines (41 loc) · 987 Bytes
/
install-script
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
#!/bin/sh
#
# Configuration script for Stats.
#
# Denora (c) 2004-2013 Nomad Team
# Contact us at [email protected]
#
# This program is free but copyrighted software; see the file COPYING for
# details.
#
# Based on the original code of Anope by Anope Team.
# Based on the original code of Thales by Lucas.
#
###########################################################################
SRC= ; DEST= ; MODE= ; USER= ; GROUP= ; export SRC DEST MODE USER GROUP
while [ $# -gt 0 ] ; do
case $1 in
-m) MODE=$2; shift; shift;;
-u) USER=$2; shift; shift;;
-g) GROUP=$2; shift; shift;;
-c) shift;;
*) SRC="$DEST"; DEST="$1"; shift;;
esac
done
if [ ! "$DEST" ] ; then
echo >&2 "Usage: $0 [-c] [-m mode] [-u user] [-g group] source dest"
exit 1
fi
if [ -d "$DEST" ] ; then
DEST="$DEST/$SRC"
fi
/bin/cp -p "$SRC" "$DEST"
if [ "$MODE" ] ; then
/bin/chmod $MODE "$DEST"
fi
if [ "$USER" ] ; then
/bin/chown "$USER" "$DEST"
fi
if [ "$GROUP" ] ; then
/bin/chgrp "$GROUP" "$DEST"
fi