summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskar <[email protected]>2023-05-24 12:29:33 +0000
committerOskar <[email protected]>2023-05-24 12:29:33 +0000
commit167c1f2600f961147cbeb6e7c4f8f00eb46f51a7 (patch)
tree91754308e8626ff29b2200c1027d81f8cb5eca05
Script
-rw-r--r--README1
-rwxr-xr-xsmbedit.sh16
2 files changed, 17 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..52f40d3
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+Some of the scripts that i might need when working on my server.
diff --git a/smbedit.sh b/smbedit.sh
new file mode 100755
index 0000000..df3ed1b
--- /dev/null
+++ b/smbedit.sh
@@ -0,0 +1,16 @@
+mkdir -p ~/smb-backups
+cp /etc/samba/smb.conf ~/smb-backups/smb_$(date +"%Y%m%d_%H%M").conf
+sudo vim /etc/samba/smb.conf
+
+read -r -p "Do you want to restart the smbd daemon? [y/N] " response
+case "$response" in
+ [yY][eE][sS]|[yY])
+ sudo systemctl restart smbd
+ echo "smbd will restart"
+ echo "The old smb.conf file was copied to ~/smb-backups"
+ ;;
+ *)
+ echo "smbd will not restart"
+ echo "The old smb.conf file was copied to ~/smb-backups"
+ ;;
+esac