Add is_ubuntu function
This replaces all of the [[ "$os_PACKAGE" = "deb" ]] tests, except when
those tests are before straight calls to dpkg.
Change-Id: I8a3ebf1b1bc5a55d736f9258d5ba1d24dabf04ea
diff --git a/lib/swift b/lib/swift
index 366c467..140e5e9 100644
--- a/lib/swift
+++ b/lib/swift
@@ -159,7 +159,7 @@
s,%SWIFT_DATA_DIR%,$SWIFT_DATA_DIR,;
" $FILES/swift/rsyncd.conf | sudo tee /etc/rsyncd.conf
# rsyncd.conf just prepared for 4 nodes
- if [[ "$os_PACKAGE" = "deb" ]]; then
+ if is_ubuntu; then
sudo sed -i '/^RSYNC_ENABLE=false/ { s/false/true/ }' /etc/default/rsync
else
sudo sed -i '/disable *= *yes/ { s/yes/no/ }' /etc/xinetd.d/rsync
@@ -341,7 +341,7 @@
# (re)start rsyslog
restart_service rsyslog
# Start rsync
- if [[ "$os_PACKAGE" = "deb" ]]; then
+ if is_ubuntu; then
sudo /etc/init.d/rsync restart || :
else
sudo systemctl start xinetd.service