My Netenv and Samba scripts
As mentioned on the install page, I had to use a
small hack (or work-around) to use netenv on my work network since it uses DHCP.
I found the work-around from
Hugo Haas. I took his scripts and used them as they were. I then made a copy of the
dhcp scripted and named the copy dhcp-work. This way, netenv would give me three choices,
one for my home network, one for my work network, and one for any DHCP network. With the
home and work scripts I added a way to change the samba config files.
At the end of the static-interface script I added:
. /etc/netenv/bringsmb home
Then at the end of dhcp-work I added:
. /etc/netenv/bringsmb nsup
The /etc/netenv/bringsmb sript is below:
#! /bin/sh
# file name /etc/netenv/bringsmb
# used to bring restart samba using either my home or my work config file
if test "$1" = "home"; then
ln -f /etc/samba/smb.conf.home /etc/samba/smb.conf
elif test "$1" = "nsup"; then
ln -f /etc/samba/smb.conf.nsup /etc/samba/smb.conf
else
echo "ERROR: Usage bringsmb [home|nsup]"
fi
/etc/init.d/samba restart
exit
I made 2 different smb.conf files, on for work and on for school. The main changes were
for the workgroups, password files, and for the shared folders. With the
bringsmb script the correct samba config file would be linked to smb.conf.







