mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 14:15:46 +00:00
To reduce duplicated code and simplified scripts introduce scylla_lib.sh for shellscripts which provides functions to classify distributions, and load all sysconfig files. This also fixes script bugs to misdetect Debian and RHEL. Signed-off-by: Takuya ASADA <syuu@scylladb.com> Message-Id: <1480667672-9453-2-git-send-email-syuu@scylladb.com>
30 lines
497 B
Bash
30 lines
497 B
Bash
#
|
|
# Copyright (C) 2016 ScyllaDB
|
|
|
|
is_debian_variant() {
|
|
[ -f /etc/debian_version ]
|
|
}
|
|
|
|
is_systemd() {
|
|
grep -q '^systemd$' /proc/1/comm
|
|
}
|
|
|
|
is_ec2() {
|
|
[ -f /sys/hypervisor/uuid ] && [ "$(head -c 3 /sys/hypervisor/uuid)" = "ec2" ]
|
|
}
|
|
|
|
. /etc/os-release
|
|
if is_debian_variant; then
|
|
SYSCONFIG=/etc/default
|
|
else
|
|
SYSCONFIG=/etc/sysconfig
|
|
fi
|
|
. $SYSCONFIG/scylla-server
|
|
|
|
for i in /etc/scylla.d/*.conf; do
|
|
if [ "$i" = "/etc/scylla.d/*.conf" ]; then
|
|
break
|
|
fi
|
|
. "$i"
|
|
done
|