636 |
# recursive |
# recursive |
637 |
if [[ $1 = -r ]] || [[ $1 = -R ]] |
if [[ $1 = -r ]] || [[ $1 = -R ]] |
638 |
then |
then |
639 |
opts="--recursive" |
opts="-R" |
640 |
source="$2" |
source="$2" |
641 |
dest="$3" |
dest="$3" |
642 |
fi |
fi |
644 |
# recursive |
# recursive |
645 |
if [[ $1 = -rf ]] || [[ $1 = -fr ]] || [[ $1 = -Rf ]] || [[ $1 = -fR ]] |
if [[ $1 = -rf ]] || [[ $1 = -fr ]] || [[ $1 = -Rf ]] || [[ $1 = -fR ]] |
646 |
then |
then |
647 |
opts="--recursive --force" |
opts="-R -f" |
648 |
source="$2" |
source="$2" |
649 |
dest="$3" |
dest="$3" |
650 |
fi |
fi |
651 |
|
|
652 |
if [[ $1 = -a ]] |
if [[ $1 = -a ]] |
653 |
then |
then |
654 |
opts="--archive" |
opts="-a" |
655 |
source="$2" |
source="$2" |
656 |
dest="$3" |
dest="$3" |
657 |
fi |
fi |
671 |
# force |
# force |
672 |
if [[ $1 = -f ]] |
if [[ $1 = -f ]] |
673 |
then |
then |
674 |
opts="--force" |
opts="-f" |
675 |
source="$2" |
source="$2" |
676 |
dest="$3" |
dest="$3" |
677 |
fi |
fi |
717 |
# recursive |
# recursive |
718 |
if [[ $1 = -r ]] || [[ $1 = -R ]] |
if [[ $1 = -r ]] || [[ $1 = -R ]] |
719 |
then |
then |
720 |
local recursive="--recursive" |
local recursive="-R" |
721 |
local owner="$2" |
local owner="$2" |
722 |
local path="$3" |
local path="$3" |
723 |
fi |
fi |
737 |
# recursive |
# recursive |
738 |
if [[ $1 = -r ]] || [[ $1 = -R ]] |
if [[ $1 = -r ]] || [[ $1 = -R ]] |
739 |
then |
then |
740 |
local recursive="--recursive" |
local recursive="-R" |
741 |
local posix="$2" |
local posix="$2" |
742 |
local path="$3" |
local path="$3" |
743 |
fi |
fi |
769 |
{ |
{ |
770 |
local unit |
local unit |
771 |
local file |
local file |
772 |
|
local prefix |
773 |
|
|
774 |
[[ -z "$1" ]] && die "No unit given" |
[[ -z "$1" ]] && die "No unit given" |
775 |
|
|
776 |
|
# get the right prefix for newer systemd |
777 |
|
[[ -x /bin/systemctl ]] && prefix="" |
778 |
|
[[ -x /usr/bin/systemctl ]] && prefix="/usr" |
779 |
|
|
780 |
# if no fullpath given use file from sourcedir |
# if no fullpath given use file from sourcedir |
781 |
if [[ -z $(dirname $1) ]] || [[ $(dirname $1) = . ]] |
if [[ -z $(dirname $1) ]] || [[ $(dirname $1) = . ]] |
782 |
then |
then |
793 |
fi |
fi |
794 |
|
|
795 |
# needed directory |
# needed directory |
796 |
install -d ${BINDIR}/lib/systemd/system || die |
install -d ${BINDIR}${prefix}/lib/systemd/system || die |
797 |
|
|
798 |
# install our initscript |
# install our initscript |
799 |
install -v -m 0644 -o root -g root ${file} ${BINDIR}/lib/systemd/system/${unit} || die |
install -v -m 0644 -o root -g root ${file} ${BINDIR}${prefix}/lib/systemd/system/${unit} || die |
800 |
} |
} |
801 |
|
|
802 |
# installs systemd tmp configs to /etc/tmpfiles.d |
# installs systemd tmp configs to /etc/tmpfiles.d |