-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Patch: dns forwarder resolve only #134
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/lac/unix/unix_scripts/general/patches/2024-08-01_dns_forwarder_only.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Get the current file name | ||
FILE_NAME=$(basename $0) | ||
# Get the date of the filename which is like this: 2024-06-25 | ||
DATE=${FILE_NAME:0:10} | ||
# Check if the file is older than 365 days | ||
if [ $(( ($(date +%s) - $(date -d $DATE +%s)) / 86400 )) -gt 365 ]; then | ||
echo "Patch is older than 365 days. Exiting patch." | ||
exit 0 | ||
fi | ||
|
||
# Check if we need to apply the patch | ||
# Check if "dns forwarder resolve only" is set in /etc/samba/smb.conf. If yes, then we need to exit the patch | ||
if grep -q "dns forwarder resolve only" /etc/samba/smb.conf; then | ||
echo "dns forwarder resolve only is already set. Exiting patch." | ||
exit 0 | ||
fi | ||
|
||
# Set "dns forwarder resolve only" in /etc/samba/smb.conf | ||
echo "" >> /etc/samba/smb.conf | ||
echo "# Only resolve DNS requests via the forwarder" >> /etc/samba/smb.conf | ||
echo "dns forwarder resolve only = yes" >> /etc/samba/smb.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters