Fix dapostinstall update step under set -e

This commit is contained in:
Marek Miklewicz
2026-06-13 18:44:52 +02:00
parent 6c377b2242
commit 0ecb158b3d
2 changed files with 12 additions and 2 deletions
+10 -2
View File
@@ -63,6 +63,15 @@ build_php_extension() {
da build set "$option" yes da build set "$option" yes
da build "$target" da build "$target"
} }
update_daupdate_tools() {
echo "update..."
wget "$HTLINK/daupdate.sh" -O /sbin/daupdate
chmod +x /sbin/daupdate
wget "$HTLINK/daupdate.sh" -O /opt/daupdate
wget "$HTLINK/da_cli.sh" -O /sbin/dacli
chmod +x /sbin/dacli
}
exec > >(tee -ia "$LOG_FILE") 2>&1 exec > >(tee -ia "$LOG_FILE") 2>&1
cd "$DAPOSTINSTALL_DIR" cd "$DAPOSTINSTALL_DIR"
# shellcheck source=lib/common.sh # shellcheck source=lib/common.sh
@@ -76,8 +85,7 @@ yum -y install epel-release
yum -y install htop wget rsync nano mc ncdu borgbackup screen net-tools htop libmemcached libmemcached-devel yum -y install htop wget rsync nano mc ncdu borgbackup screen net-tools htop libmemcached libmemcached-devel
cp daupdate.sh /opt cp daupdate.sh /opt
chmod 700 /opt/daupdate.sh chmod 700 /opt/daupdate.sh
cd /opt/ update_daupdate_tools
/opt/daupdate.sh update
cd "$DAPOSTINSTALL_DIR" cd "$DAPOSTINSTALL_DIR"
clear clear
cd "$DAPOSTINSTALL_DIR" cd "$DAPOSTINSTALL_DIR"
+2
View File
@@ -51,6 +51,8 @@ assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^opcache=yes$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^imap=yes$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^imap=yes$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^imagick=yes$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^imagick=yes$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^SETUP_TXT="\$DADIR/conf/setup\.txt"$' assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^SETUP_TXT="\$DADIR/conf/setup\.txt"$'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" '^update_daupdate_tools\(\) \{$'
assert_file_not_contains "$ROOT_DIR/dapostinstall.sh" '/opt/daupdate\.sh update'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'require_file "\$SETUP_TXT"' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'require_file "\$SETUP_TXT"'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'DA_ADMINPASS=\$\(get_key_value "\$SETUP_TXT" "adminpass"\)' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'DA_ADMINPASS=\$\(get_key_value "\$SETUP_TXT" "adminpass"\)'
assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'set_key_value "\$DADIR/conf/directadmin\.conf" "ns1" "\$DEFAULT_NS1"' assert_file_contains "$ROOT_DIR/dapostinstall.sh" 'set_key_value "\$DADIR/conf/directadmin\.conf" "ns1" "\$DEFAULT_NS1"'