homelab/scripts/smbshare/script.sh

32 lines
601 B
Bash
Raw Normal View History

2022-12-31 22:46:38 +01:00
#!/bin/bash
# Template script not meant to be run
set -euo pipefail;
source "$HL_LIB";
_ch_001-install_deps() {
sudo apt-get install -y samba avahi-daemon;
}
_ch_002-create_user() {
sudo useradd --system --shell /usr/sbin/nologin abmas;
}
_ch_003-create_and_chmod_root() {
mkdir -p /data/smbshare;
sudo chown -R abmas /data/smbshare;
}
_ch_004-configure_smbd() {
cat smb.conf | sudo tee /etc/samba/smb.conf
sudo systemctl reload smbd.service
}
2022-12-31 22:49:08 +01:00
_ch_005-allow_firewall() {
if command -v ufw &> /dev/null; then
sudo ufw allow samba;
fi;
}
2022-12-31 22:46:38 +01:00
_run_checkpoints;