differentiate between installing in $HOME and system wide
[wmiirc-lua.git] / install-wmiirc-lua
blob7f379680c0ec4ef96c8550593d3306e7d5b92957
1 #!/bin/bash
2 # Copyright (c) 2007, Bart Trojanowski <bart@jukie.net>
4 # This script installs wmiirc-lua files into $HOME/.wmii-3.5
6 SRC=/etc/X11/wmii-3.5
7 DEST=${HOME}/.wmii-3.5
9 do_install () {
10 INSTALL="install $@"
12 ${INSTALL} -d ${DEST}
13 for f in "$SRC"/* ; do
14 ${INSTALL} -t ${DEST} ${f}
15 done
18 while true ; do
19 cmd=$1 ; shift
20 case $cmd in
21 --force)
22 do_install
24 --backup)
25 do_install -b
28 break
30 esac
31 done
33 if [ -f "${SRC}/wmiirc" ] ; then
34 echo >&2 "System wide files for wmiirc-lua not installed."
35 exit 1
38 if [ -f "${DEST}/wmiirc" ] ; then
39 echo >&2 "You already have files installed in ${DEST}."
40 echo >&2 ""
41 echo >&2 "Please select one of the following options and rerun this script:"
42 echo >&2 ""
43 echo >&2 " $0 --force - overwrite existing files"
44 echo >&2 " $0 --backup - backup existing files"
45 exit 1