22
33# Copyright (c) 2021-2025 tteck
44# Author: tteck (tteckster)
5- # License: MIT
6- # https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
5+ # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
76
87source /dev/stdin <<< " $FUNCTIONS_FILE_PATH"
98color
@@ -14,23 +13,24 @@ network_check
1413update_os
1514
1615msg_info " Installing Dependencies"
17- $STD apt-get install -y curl
18- $STD apt-get install -y sudo
19- $STD apt-get install -y mc
16+ $STD apt-get install -y \
17+ curl \
18+ sudo \
19+ mc
2020msg_ok " Installed Dependencies"
2121
22+ msg_info " Setup TriliumNext"
23+ cd /opt
2224RELEASE=$( curl -s https://api.github.com/repos/TriliumNext/Notes/releases/latest | grep " tag_name" | awk ' {print substr($2, 2, length($2)-3) }' )
23-
24- msg_info " Installing TriliumNext"
2525wget -q https://github.com/TriliumNext/Notes/releases/download/${RELEASE} /TriliumNextNotes-linux-x64-${RELEASE} .tar.xz
2626tar -xf TriliumNextNotes-linux-x64-${RELEASE} .tar.xz
2727mv trilium-linux-x64-server /opt/trilium
28- msg_ok " Installed TriliumNext"
28+ echo " ${RELEASE} " > " /opt/${APPLICATION} _version.txt"
29+ msg_ok " Setup TriliumNext"
2930
3031msg_info " Creating Service"
31- service_path=" /etc/systemd/system/trilium.service"
32-
33- echo " [Unit]
32+ cat << EOF >/etc/systemd/system/trilium.service
33+ [Unit]
3434Description=Trilium Daemon
3535After=syslog.target network.target
3636
@@ -43,15 +43,16 @@ TimeoutStopSec=20
4343Restart=always
4444
4545[Install]
46- WantedBy=multi-user.target" > $service_path
46+ WantedBy=multi-user.target
47+ EOF
4748systemctl enable --now -q trilium
4849msg_ok " Created Service"
4950
5051motd_ssh
5152customize
5253
5354msg_info " Cleaning up"
55+ rm -rf /opt/TriliumNextNotes-linux-x64-${RELEASE} .tar.xz
5456$STD apt-get -y autoremove
5557$STD apt-get -y autoclean
56- rm -rf TriliumNextNotes-linux-x64-${RELEASE} .tar.xz
5758msg_ok " Cleaned"
0 commit comments