Advertisement
s243a

refreshMainWindowInfo() -- /usr/sbin/net-setup.sh puppylinux

Oct 7th, 2016
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. #lines 178 to 242 of /usr/sbin/net-setup.sh (puppylinux)
  2. # http://www.pearltrees.com/s243a/usr-sbin-net-setup-puppylinux/id16430354
  3. refreshMainWindowInfo ()
  4. {
  5. # Dougal: comment out and move to the showLoadModuleWindow -- only used there...
  6. #findLoadedModules
  7. getInterfaceList
  8. #rm -f /tmp/interface-modules
  9.  
  10. for INTERFACE in $INTERFACES
  11. do
  12. [ "$INTERFACE" ] || continue
  13. # Dougal: use function for finding/setting info to be used in tree (below)
  14. findInterfaceInfo "$INTERFACE"
  15.  
  16. ## Dougal: use a tree to display interface info
  17. INTERFACE_DATA="$INTERFACE_DATA <item>$INTERFACE|$INTTYPE|$FI_DRIVER|$TYPE: $INFO</item>"
  18. # add to display list
  19. INTERFACEBUTTONS="
  20. ${INTERFACEBUTTONS}
  21. <vbox>
  22. <pixmap><input file>$BLANK_IMAGE</input></pixmap>
  23. <button>
  24. <label>${INTERFACE}</label>
  25. <action>EXIT:Interface_${INTERFACE}</action>
  26. </button>
  27. </vbox>"
  28. done
  29.  
  30. if [ "$INTERFACE_DATA" ] ; then
  31. # Get the right height for the tree...
  32. case "$INTERFACE_NUM" in
  33. 1) HEIGHT=70 ;;
  34. 2) HEIGHT=100 ;;
  35. 3) HEIGHT=125 ;;
  36. 4) HEIGHT=150 ;;
  37. 5) HEIGHT=175 ;;
  38. 6) HEIGHT=200 ;;
  39. esac
  40. INTERFACEBUTTONS="
  41. <tree>
  42. <label>$L_LABEL_Interface_Tree_Header</label>
  43. $INTERFACE_DATA
  44. <height>$HEIGHT</height><width>350</width>
  45. <variable>SELECTED_INTERFACE</variable>
  46. </tree>
  47. <hbox>
  48. $INTERFACEBUTTONS
  49. </hbox>"
  50. fi
  51.  
  52. case $INTERFACE_NUM in
  53. 0) # no interfaces
  54. echo "$L_ECHO_No_Interfaces_Message" > /tmp/net-setup_MSGINTERFACES.txt
  55. ;;
  56. 1) # only one
  57. echo "$L_ECHO_One_Interface_Message" > /tmp/net-setup_MSGINTERFACES.txt
  58. ;;
  59. *) # more than one interface
  60. echo "$L_ECHO_Multiple_Interfaces_Message" > /tmp/net-setup_MSGINTERFACES.txt
  61. ;;
  62. esac
  63.  
  64. #echo "Puppy has done a quick check to see which network driver modules are currently loaded. Here they are (the relevant interface is in brackets):
  65. #${LOADEDETH}" > /tmp/net-setup_MSGMODULES.txt
  66.  
  67. } # end refreshMainWindowInfo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement