-
Notifications
You must be signed in to change notification settings - Fork 18
/
savagewheels.in
executable file
·42 lines (37 loc) · 1.44 KB
/
savagewheels.in
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
export SAVAGEWHEELS_SYS_DATADIR="${SAVAGEWHEELS_SYS_DATADIR-@INSTALL_DATADIR@}"
export SAVAGEWHEELS_LIBEXECDIR="${SAVAGEWHEELS_LIBEXECDIR-@INSTALL_LIBEXECDIR@}"
export SAVAGEWHEELS_USR_CONFDIR="${SAVAGEWHEELS_USR_CONFDIR-${HOME}/.config/savagewheels}"
export SAVAGEWHEELS_USR_DATADIR="${SAVAGEWHEELS_USR_DATADIR-${HOME}/.local/share/savagewheels}"
if [ ! -d ${SAVAGEWHEELS_USR_CONFDIR} ]; then
if [ -e ${SAVAGEWHEELS_USR_CONFDIR} ]; then
printf "${SAVAGEWHEELS_USR_CONFDIR} exists but is not a directory.\n" >&2
printf " Please remove.\n" >&2
exit 1
fi
mkdir -p ${SAVAGEWHEELS_USR_CONFDIR}
if [ $? -ne 0 ]; then
printf "Failed to create ${SAVAGEWHEELS_USR_CONFDIR}\n" >&2
exit 1
fi
fi
if [ ! -d ${SAVAGEWHEELS_USR_DATADIR} ]; then
if [ -e ${SAVAGEWHEELS_USR_DATADIR} ]; then
printf "${SAVAGEWHEELS_USR_DATADIR} exists but is not a directory.\n" >&2
printf " Please remove.\n" >&2
exit 1
fi
mkdir -p ${SAVAGEWHEELS_USR_DATADIR}
if [ $? -ne 0 ]; then
printf "Failed to create ${SAVAGEWHEELS_USR_DATADIR}\n" >&2
exit 1
fi
fi
if [ ! -e ${SAVAGEWHEELS_USR_CONFDIR}/bindings.xml ]; then
cp ${SAVAGEWHEELS_SYS_DATADIR}/bindings.xml ${SAVAGEWHEELS_USR_CONFDIR}
if [ $? -ne 0 ]; then
printf "Failed to create ${SAVAGEWHEELS_USR_CONFDIR}/bindings.xml\n" >&2
exit 1
fi
fi
exec ${SAVAGEWHEELS_LIBEXECDIR}/savagewheels "$@"