feat(post_install_script): add nfs for serverhost and mediahost
This commit is contained in:
1 parent
d7ca74d3d1
commit
e24f9f3464
1 file changed
+19
-2
@@ -11,9 +11,28 @@ sudo flatpak install -y flathub com.moonlight_stream.Moonlight
|
|||||||
# Install Jellyfin Media Player
|
# Install Jellyfin Media Player
|
||||||
sudo flatpak install flathub org.jellyfin.JellyfinDesktop
|
sudo flatpak install flathub org.jellyfin.JellyfinDesktop
|
||||||
# Create NFS share
|
# Create NFS share
|
||||||
|
if $HOST == "serverhost"
|
||||||
echo "/torrent/qbittorrent/downloads 192.168.0.4(rw,sync,no_subtree_check)
|
echo "/torrent/qbittorrent/downloads 192.168.0.4(rw,sync,no_subtree_check)
|
||||||
/backup/homeassistant 192.168.0.4(rw,sync,no_subtree_check)
|
/backup/homeassistant 192.168.0.4(rw,sync,no_subtree_check)
|
||||||
" | sudo tee -a /etc/exports
|
" | sudo tee -a /etc/exports
|
||||||
|
sudo ufw allow from 192.168.0.4 to any port 111 proto tcp
|
||||||
|
sudo ufw allow from 192.168.0.4 to any port 2049 proto tcp
|
||||||
|
sudo ufw allow from 192.168.0.4 to any port 111 proto udp
|
||||||
|
sudo ufw allow from 192.168.0.4 to any port 2049 proto udp
|
||||||
|
echo "/data/torrent/qbittorrent/mediahost 192.168.0.2(rw,sync,no_subtree_check)
|
||||||
|
" | sudo tee -a /etc/exports
|
||||||
|
echo "192.168.0.4:/data/torrent/qbittorrent/mediahost /torrent/qbittorrent/mediahost nfs defaults,nofail,x-systemd.automount,x-systemd.mount-timeout=30,_netdev 0 0
|
||||||
|
" | sudo tee -a /etc/fstab
|
||||||
|
elif $HOST == "mediahost"
|
||||||
|
sudo ufw allow from 192.168.0.2 to any port 111 proto tcp
|
||||||
|
sudo ufw allow from 192.168.0.2 to any port 2049 proto tcp
|
||||||
|
sudo ufw allow from 192.168.0.2 to any port 111 proto udp
|
||||||
|
sudo ufw allow from 192.168.0.2 to any port 2049 proto udp
|
||||||
|
echo " 192.168.0.2:/torrent/qbittorrent-private/downloads /data/torrent/qbittorrent-private/downloads nfs defaults,nofail,x-systemd.automount,x-systemd.mount-timeout=30,_netdev 0 0
|
||||||
|
192.168.0.2:/torrent/qbittorrent-public/downloads /data/torrent/qbittorrent-public/downloads nfs defaults,nofail,x-systemd.automount,x-systemd.mount-timeout=30,_netdev 0 0
|
||||||
|
192.168.0.2:/data/torrent /data/torrent/qbittorrent-special/downloads nfs defaults,nofail,x-systemd.automount,x-systemd.mount-timeout=30,_netdev 0 0
|
||||||
|
" | sudo tee -a /etc/fstab
|
||||||
|
fi
|
||||||
sudo exportfs -ra
|
sudo exportfs -ra
|
||||||
sudo systemctl enable --now nfs-kernel-server
|
sudo systemctl enable --now nfs-kernel-server
|
||||||
# Show active exports
|
# Show active exports
|
||||||
@@ -84,8 +103,6 @@ sudo systemctl enable --now smartctl-exporter
|
|||||||
cat scripts/other/smartd.conf | sed "/# $(hostname)/,/# $(hostname) end/ s/^# *//" smartd.conf | sudo tee /etc/smartd.conf
|
cat scripts/other/smartd.conf | sed "/# $(hostname)/,/# $(hostname) end/ s/^# *//" smartd.conf | sudo tee /etc/smartd.conf
|
||||||
|
|
||||||
sudo ufw allow 9633/tcp
|
sudo ufw allow 9633/tcp
|
||||||
sudo ufw allow 111/tcp
|
|
||||||
sudo ufw allow 2049/tcp
|
|
||||||
sudo ufw allow 22/tcp
|
sudo ufw allow 22/tcp
|
||||||
sudo ufw allow 9100/tcp
|
sudo ufw allow 9100/tcp
|
||||||
sudo ufw enable
|
sudo ufw enable
|
||||||
|
|||||||
Reference in new issue
Block a user