Fortinet white logo
Fortinet white logo

Administration Guide

macOS

macOS

Mapping a network drive after tunnel connection

The script maps a network drive and copies some files after the tunnel connects. If configuring this script using the Mac On Connect Script field in the EMS VPN tunnel settings in Advanced Settings > On Connect Script, enter the following:

/bin/mkdir /Volumes/installers

/sbin/ping -c 4 192.168.1.147 > /Users/admin/Desktop/dropbox/p.txt

/sbin/mount -t smbfs //kimberly:RigUpTown@ssldemo.fortinet.com/installers /Volumes/installers/ > /Users/admin/Desktop/dropbox/m.txt

/bin/mkdir /Users/admin/Desktop/dropbox/dir

/bin/cp /Volumes/installers/*.log /Users/admin/Desktop/dropbox/dir/.

If configuring this script by editing the XML configuration, enter the following:

<on_connect>

<script>

<os>mac</os>

<script>

/bin/mkdir /Volumes/installers

/sbin/ping -c 4 192.168.1.147 > /Users/admin/Desktop/dropbox/p.txt

/sbin/mount -t smbfs //kimberly:RigUpTown@ssldemo.fortinet.com/installers /Volumes/installers/ > /Users/admin/Desktop/dropbox/m.txt

/bin/mkdir /Users/admin/Desktop/dropbox/dir

/bin/cp /Volumes/installers/*.log /Users/admin/Desktop/dropbox/dir/.

</script>

</script>

</on_connect>

Deleting a network drive after tunnel disconnection

The script deletes the network drive after the tunnel disconnects. If configuring this script using the Mac On Connect Script field in the EMS VPN tunnel settings in Advanced Settings > On Connect Script, enter the following:

/sbin/umount /Volumes/installers

/bin/rm -fr /Users/admin/Desktop/dropbox/*

If configuring this script by editing the XML configuration, enter the following:

<on_disconnect>

<script>

<os>mac</os>

<script>

/sbin/umount /Volumes/installers

/bin/rm -fr /Users/admin/Desktop/dropbox/*

</script>

</script>

</on_disconnect>

macOS

macOS

Mapping a network drive after tunnel connection

The script maps a network drive and copies some files after the tunnel connects. If configuring this script using the Mac On Connect Script field in the EMS VPN tunnel settings in Advanced Settings > On Connect Script, enter the following:

/bin/mkdir /Volumes/installers

/sbin/ping -c 4 192.168.1.147 > /Users/admin/Desktop/dropbox/p.txt

/sbin/mount -t smbfs //kimberly:RigUpTown@ssldemo.fortinet.com/installers /Volumes/installers/ > /Users/admin/Desktop/dropbox/m.txt

/bin/mkdir /Users/admin/Desktop/dropbox/dir

/bin/cp /Volumes/installers/*.log /Users/admin/Desktop/dropbox/dir/.

If configuring this script by editing the XML configuration, enter the following:

<on_connect>

<script>

<os>mac</os>

<script>

/bin/mkdir /Volumes/installers

/sbin/ping -c 4 192.168.1.147 > /Users/admin/Desktop/dropbox/p.txt

/sbin/mount -t smbfs //kimberly:RigUpTown@ssldemo.fortinet.com/installers /Volumes/installers/ > /Users/admin/Desktop/dropbox/m.txt

/bin/mkdir /Users/admin/Desktop/dropbox/dir

/bin/cp /Volumes/installers/*.log /Users/admin/Desktop/dropbox/dir/.

</script>

</script>

</on_connect>

Deleting a network drive after tunnel disconnection

The script deletes the network drive after the tunnel disconnects. If configuring this script using the Mac On Connect Script field in the EMS VPN tunnel settings in Advanced Settings > On Connect Script, enter the following:

/sbin/umount /Volumes/installers

/bin/rm -fr /Users/admin/Desktop/dropbox/*

If configuring this script by editing the XML configuration, enter the following:

<on_disconnect>

<script>

<os>mac</os>

<script>

/sbin/umount /Volumes/installers

/bin/rm -fr /Users/admin/Desktop/dropbox/*

</script>

</script>

</on_disconnect>