Skip to content

Commit f75c393

Browse files
committed
Update ubuntu20-domainjoiner.sh
1 parent 28e508a commit f75c393

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ubuntu20-domainjoiner.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ echo "setting hostname to:" $HOSTNAME.REALM
5959
hostnamectl set-hostname $HOSTNAME.$REALM
6060
currentTimestamp=`date +%y-%m-%d-%H:%M:%S`
6161
echo "Backing up existing samba conf to:" /etc/samba/smb.conf.$currentTimestamp.bak
62-
mv /etc/samba/smb.conf /etc/samba/smb.conf.$currentTimestamp.bak
62+
if [ -f /etc/samba/smb.conf ]; then
63+
mv /etc/samba/smb.conf /etc/samba/smb.conf.$currentTimestamp.bak
64+
echo "Moved /etc/samba/smb.conf to /etc/samba/smb.conf.$currentTimestamp.bak"
65+
else
66+
echo "File /etc/samba/smb.conf does not exist. Skipping."
67+
fi
6368
echo "Generating kerberos ticket, please enter password at the prompt....."
6469
kinit $USERNAME@$REALM
6570
echo "Validating we can discover the domain....."

0 commit comments

Comments
 (0)