-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathubuntuNASscript.sh
44 lines (33 loc) · 928 Bytes
/
ubuntuNASscript.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /bin/bash
sudo apt -y update
sudo apt -y upgrade
sudo apt install -y samba
sudo apt install -y glances
sudo mkfs.ext4 -F /dev/md1
OUTPUT="$(sudo blkid -s UUID -o value /dev/md1$partnumber)"
echo "UUID="$OUTPUT" /md1/stuff/ ext4 rw, user, auto 0 0" | sudo tee -a /etc/fstab
sudo mkdir /md1/stuff/video
sudo mount /md1/stuff/
sudo chmod 777 /md1
sudo chmod 777 /md1/stuff
sudo chmod 777 /md1/stuff/video
sudo chmod 700 ~/.ssh
sudo mkdir /var/www/192.168.0.5/PRINT-SYSTEM/
echo "
#NAS Share dir
[NASShare]
comment = NAS_Share
path = md1/stuff
read only = yes
guest ok = yes" | sudo tee -a /etc/samba/smb.conf
echo "
#Eksamens Printer
[Printer]
comment = Printer
path = /var/www/192.168.0.5/PRINTER-SYSTEM/
read only = yes
valid users = $USER
write list = $USER
public = no
guest ok = no" | sudo tee -a etc/samba/smb.conf
echo "run smbpasswd -a $USER to set user and password for Printer SMB"