Guest User

/lib/svc/share/smf_include.sh SMF service for local tools

a guest
Sep 30th, 2022
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. /opt/custom/share/svc/smartos_setup.sh
  2.  
  3. #!/bin/bash
  4. # Simple Ad Hoc SmartOS Setup Service
  5.  
  6. set -o xtrace
  7.  
  8. . /lib/svc/share/smf_include.sh
  9.  
  10. cd /
  11. PATH=/usr/sbin:/usr/bin:/opt/custom/bin:/opt/custom/sbin; export PATH
  12.  
  13. case "$1" in
  14. 'start')
  15. #### Insert code to execute on startup here.
  16.  
  17. # hostname "timboudreau.com" && hostname > /etc/nodename
  18. echo "export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '" >> /root/.bashrc
  19. echo "export TERM=vt100" >> /root/.bashrc
  20. echo "export PATH=$PATH:/opt/bin"
  21. echo "alias ls='ls --color=auto'" >> /root/.bashrc
  22. echo 'alias vl="vmadm list"' >> /root/.bashrc
  23. # cp opt/custom/share/ipnat.conf /etc/ipf/
  24. routeadm -u -e ipv4-forwarding
  25. # svcadm restart ipfilter
  26. ln -s /usr/share/vim/vim73/vimrc_example.vim /root/.vimrc
  27. ;;
  28.  
  29. 'stop')
  30. ### Insert code to execute on shutdown here.
  31. ;;
  32.  
  33. *)
  34. echo "Usage: $0 { start | stop }"
  35. exit $SMF_EXIT_ERR_FATAL
  36. ;;
  37. esac
  38. exit $SMF_EXIT_OK
  39.  
Advertisement
Add Comment
Please, Sign In to add comment