Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2019-01-10 07:56:05 +0300
committernachoparker <nacho@ownyourbits.com>2019-01-10 07:56:42 +0300
commit9de1f51a3deadea6dd90f5385c54296780e03448 (patch)
tree9cdfed046a426c6ea9fa1307d4b968c0fae80c6d
parent2e7da45f687c00f29ced3caab9e98433f2169160 (diff)
build: stop at any error
-rwxr-xr-xbin/ncp-update34
-rw-r--r--bin/ncp/NETWORKING/dnsmasq.sh1
-rw-r--r--bin/ncp/NETWORKING/letsencrypt.sh1
-rw-r--r--bin/ncp/NETWORKING/no-ip.sh1
-rw-r--r--bin/ncp/SECURITY/UFW.sh2
-rw-r--r--bin/ncp/SYSTEM/nc-hdd-monitor.sh8
6 files changed, 25 insertions, 22 deletions
diff --git a/bin/ncp-update b/bin/ncp-update
index 6d3e3556..a68afc26 100755
--- a/bin/ncp-update
+++ b/bin/ncp-update
@@ -20,25 +20,23 @@
[[ -f /.ncp-image ]] || cd "$TMPDIR" # update locally during build
echo -e "Performing updates"
- ./update.sh && {
-
- cd "$TMPDIR"
- VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
- grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
- echo "$VER" > /usr/local/etc/ncp-version
- echo "$VER" > /var/run/.ncp-latest-version
-
- # write changelog
- git log --graph --oneline --decorate \
- --pretty=format:"[%D] %s" --date=short | \
- grep 'tag: v' | \
- sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \
- sed 's|* \[tag: |[|' > /usr/local/etc/ncp-changelog
- }
- echo -e "NextCloudPi updated to version $VER"
+ ./update.sh || exit 1
+
+ cd "$TMPDIR"
+ VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
+ grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
+ echo "$VER" > /usr/local/etc/ncp-version
+ echo "$VER" > /var/run/.ncp-latest-version
+
+ # write changelog
+ git log --graph --oneline --decorate \
+ --pretty=format:"[%D] %s" --date=short | \
+ grep 'tag: v' | \
+ sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \
+ sed 's|* \[tag: |[|' > /usr/local/etc/ncp-changelog
}
-
cd /
- exit
+ echo -e "NextCloudPi updated to version $VER"
+ exit 0
} # force to read the whole thing into memory, as its contents might change in update.sh
diff --git a/bin/ncp/NETWORKING/dnsmasq.sh b/bin/ncp/NETWORKING/dnsmasq.sh
index 3f75c6d8..6fb6f275 100644
--- a/bin/ncp/NETWORKING/dnsmasq.sh
+++ b/bin/ncp/NETWORKING/dnsmasq.sh
@@ -36,6 +36,7 @@ exit 0
EOF
chmod +x /etc/services-available.d/100dnsmasq
}
+ return 0
}
configure()
diff --git a/bin/ncp/NETWORKING/letsencrypt.sh b/bin/ncp/NETWORKING/letsencrypt.sh
index 38f4206c..51f36c22 100644
--- a/bin/ncp/NETWORKING/letsencrypt.sh
+++ b/bin/ncp/NETWORKING/letsencrypt.sh
@@ -37,6 +37,7 @@ exit 0
EOF
chmod +x /etc/services-available.d/009letsencrypt
}
+ return 0
}
# tested with certbot 0.10.2
diff --git a/bin/ncp/NETWORKING/no-ip.sh b/bin/ncp/NETWORKING/no-ip.sh
index 2043d7eb..0948b3b1 100644
--- a/bin/ncp/NETWORKING/no-ip.sh
+++ b/bin/ncp/NETWORKING/no-ip.sh
@@ -69,6 +69,7 @@ exit 0
EOF
chmod +x /etc/services-available.d/100noip
}
+ return 0
}
configure()
diff --git a/bin/ncp/SECURITY/UFW.sh b/bin/ncp/SECURITY/UFW.sh
index 791a4b1f..21c33836 100644
--- a/bin/ncp/SECURITY/UFW.sh
+++ b/bin/ncp/SECURITY/UFW.sh
@@ -18,6 +18,8 @@ install()
# Disable logging to kernel
grep -q maxsize /etc/logrotate.d/ufw || sed -i /weekly/amaxsize2M /etc/logrotate.d/ufw
+
+ return 0
}
configure()
diff --git a/bin/ncp/SYSTEM/nc-hdd-monitor.sh b/bin/ncp/SYSTEM/nc-hdd-monitor.sh
index 83b5f91d..562074a4 100644
--- a/bin/ncp/SYSTEM/nc-hdd-monitor.sh
+++ b/bin/ncp/SYSTEM/nc-hdd-monitor.sh
@@ -24,8 +24,8 @@ configure()
}
[[ "$ACTIVE" != yes ]] && {
- systemctl disable smartd
- systemctl stop smartd
+ update-rc.d smartd disable
+ service smartd stop
echo "HDD monitor disabled"
return 0
}
@@ -58,8 +58,8 @@ EOF
chmod +x /usr/local/etc/ncp-hdd-notif.sh
for dr in "${DRIVES[@]}"; do smartctl --smart=on /dev/${dr} | sed 1,2d; done
- systemctl enable smartd
- systemctl start smartd
+ update-rc.d smartd enable
+ service smartd start
echo "HDD monitor enabled"
}