summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bcc40e3)
raw | patch | inline | side by side (parent: bcc40e3)
author | Andriy Shinkarchuck <adriano32.gnu@gmail.com> | |
Tue, 26 Jul 2011 22:24:53 +0000 (01:24 +0300) | ||
committer | Andriy Shinkarchuck <adriano32.gnu@gmail.com> | |
Tue, 26 Jul 2011 22:24:53 +0000 (01:24 +0300) |
src/copy.sh | patch | blob | history |
diff --git a/src/copy.sh b/src/copy.sh
index 3dce5d44d7940bad681213ac7c6987e43c4393fd..4250b59abaec90ebf0ba4969c1bda98e36ef8f82 100755 (executable)
--- a/src/copy.sh
+++ b/src/copy.sh
#!/bin/sh
+#
+# Copyright (C) Andriy Shinkarchuck <adriano32.gnu@gmail.com> 2011
+#
+# This file is part of the Doom2D:Rembo project.
+#
+# Doom2D:Rembo is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# Doom2D:Rembo is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/> or
+# write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+set -e
WORK_DIR=`pwd`
-if (($#==0)); then
- DEST_DIR=/usr/share/doom2d-rembo ;
- mkdir /usr/share/doom2d-rembo ;
+if [ $# -eq 0 ]; then
+ DEST_DIR=/usr/share/doom2d-rembo
+ if [ -d $DEST_DIR ]; then
+ if [ "$(ls -A $DEST_DIR)" ]; then
+ echo "Error: "$DEST_DIR" is not empty. Please, check it content and delete if it is unnecesary before starting"
+ exit 1
+ fi
+ else
+ mkdir $DEST_DIR
+ chmod 755 $DEST_DIR
+ fi
if [ -d $DEST_DIR ]; then
if [ -d $WORK_DIR/../music ]; then
cp -R $WORK_DIR/../music $DEST_DIR/music
cp $WORK_DIR/megadm.wad $DEST_DIR
cp $WORK_DIR/superdm.wad $DEST_DIR
cp $WORK_DIR/default.cfg $DEST_DIR;
+ echo "Copying data files to "$DEST_DIR" completed succesfully"
else
echo "music subdirectory was not found in "$WORK_DIR". Check you source tarball consistency";
fi