pmount 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  1. #!/bin/sh
  2. #(c) Copyright Nov 2007 Barry Kauler www.puppylinux.com
  3. #2007 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
  4. #a complete rewrite for Puppy 'Dingo', Nov 27 2007, Dec 1,5 2007.
  5. #v3.95 4jan2007: -x option for rox.
  6. #v3.96 17jan2008: full install, mounted '/' partition was not shown.
  7. #v3.98 13mar2008: switch probepart and mut2 engines.
  8. #v3.99 7apr2008: fix zombie process prevents partition unmount.
  9. #v4.01 7may2008: allow /sbin/pup_ueventd to kill pmount and cause it to restart.
  10. #v4.01 10may2008: using 'probedisk2' script.
  11. #v4.01 10may2008: redesign of xml generation, much more efficient.
  12. #v4.01 11may2008: passed params sd,sr,mm,fd when called from pup_dock_xx tray applets.
  13. #v4.01 13may2008: introduce 'preferences' button, add toggle tabbed-normal view.
  14. #v4.01 17may2008: make sure top tab stays on top when mount/unmount.
  15. #v4.01 18may2008: auto launch of pmount when a drive plugged is now confgurable, see prefs.
  16. #v4.02 31may2008: refresh desktop icons when mount/unmount (see pup_eventd).
  17. #v404 11jul08: unipup, disable unmount button correctly.
  18. #v407 mut bugfix.
  19. #v408 bugfix, a drive with no valid partitions crashed pmount.
  20. #v409 jesse: bugfix for floppy detection when using mut2 engine.
  21. #v410 catch case no valid partitions/drvs in a category, remove that category.
  22. #v411 added 'quiet' option for vfat, suppresses error msg when file attribs not preserved on copy.
  23. #v412, no, do not exit if only a warning error msg.
  24. #v420JPa1 4Jun09: fix mount iso9660, ext2/ext3
  25. # 27jun09 I18N, vfat mount options by Masaki Shinomiya <shino@pos.to>
  26. # 08jul09 ask to eject CD
  27. #w476 fix codepage for vfat f.s. ... neglected by Masaki Shinomiya
  28. #w477 fix pmount crash when running xvesa.
  29. #100127 codepage fixes. 100131 iso9660 fix.
  30. #101005 maddox: added m_40 cancel message, fixed usage of m_31.
  31. #110208 zigbert: improve gui layout. bk: put this on-hold for now, see 3 commented lines.
  32. #110505 support sudo for non-root user.
  33. #110720 should not open a layer inside aufs, ex: session saved entire partition, desktop drive icon is /initrd/pup_rw.
  34. #110814 01micko: convert script from gtkdialog2 to gtkdialog3+.
  35. #120203 preferences was broken.
  36. #120129 karl godt: fix ZOMBIES, see http://murga-linux.com/puppy/viewtopic.php?t=71767&start=420. see also rc.shutdown, drive_all, pup_event_frontend_d.
  37. #120323 partial replace 'gxmessage' with 'pupmessage'.
  38. #120411 zigbert: gui rewrite, volume-lables, integration of partview, mount at boot
  39. #130128 convert "technosaurus method" i18n to gettext. mut2 option removed (very old, no longer works properly).
  40. #130128 fixed for 'udf' f.s. (see also pup_event_frontend_d, drive_all, probepart).
  41. #130205 zigbert: correct size of bar to report used space on filesystem.
  42. #130216 support f2fs.
  43. [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
  44. #NOTE: not to clash with 'pmount.mo' used by previous i18n method.
  45. export TEXTDOMAIN=pupmount
  46. export OUTPUT_CHARSET=UTF-8
  47. . gettext.sh
  48. #using ${$} which is pid of script...
  49. MYPID=${$}
  50. . /etc/rc.d/PUPSTATE #v3.96
  51. export PMOUNT="pmount" #name of this executable.
  52. . /etc/rc.d/functions4puppy4 #v4.02
  53. #build script to reload gui from mountme funtion
  54. echo 'TMP="`ps`"; for I in `echo "$TMP" | grep -F "pmount" | awk '"'"'{print $1}'"'"'`; do kill -9 $I 2> /dev/null; done; exec /usr/sbin/'"$PMOUNT $TOPACTUAL" > /tmp/pmount_reload
  55. chmod 722 /tmp/pmount_reload
  56. #---
  57. #read config - this does not include options from the preferences window
  58. [ -f $HOME/.pmountrc ] && . $HOME/.pmountrc
  59. if [ ! "$HEIGHT" ]; then
  60. HEIGHT=350
  61. WIDTH=500
  62. export COLOR_SPACEFREE='#3FA04E'
  63. export COLOR_SPACEUSED='#D7302A'
  64. export COLOR_SPACELOCKED='#EDBF4D'
  65. fi
  66. ###################################################################################
  67. # #
  68. # F U N C T I O N S #
  69. # #
  70. ###################################################################################
  71. buildheading (){
  72. ONEDISK="$1"
  73. ONECATEGORY="$2"
  74. ONEDISKDESCR="$3"
  75. ONEDISKNAME="`echo "$ONEDISK" | cut -f 3 -d '/'`"
  76. case $ONECATEGORY in
  77. drive)
  78. ICON=/usr/local/lib/X11/pixmaps/drive48.png
  79. PARTSIZE="`parted $ONEDISK print | grep "^Disk" | cut -d: -f2 | tr -d ' '`"
  80. ;;
  81. optical)
  82. ICON=/usr/local/lib/X11/pixmaps/optical48.png
  83. PARTSIZE=''
  84. ;;
  85. usbdrv)
  86. ICON=/usr/local/lib/X11/pixmaps/usbdrv48.png
  87. PARTSIZE="`parted $ONEDISK print | grep "^Disk" | cut -d: -f2 | tr -d ' '`"
  88. ;;
  89. card)
  90. ICON=/usr/local/lib/X11/pixmaps/card48.png
  91. PARTSIZE="`parted $ONEDISK print | grep "^Disk" | cut -d: -f2 | tr -d ' '`"
  92. ;;
  93. floppy)
  94. ICON=/usr/local/lib/X11/pixmaps/floppy48.png
  95. PARTSIZE=''
  96. ;;
  97. esac
  98. if [ "`echo $ONECATEGORY | grep -E "optical|usbdrv|card"`" ] && [ "`mount | grep "^$ONEDISK"`" ]; then
  99. PIXLOCK='<circle cx="18" cy="18" r="14" style="fill:#F1AB24;stroke:#875900;stroke-width:2;fill-opacity:0.8;stroke-opacity:0.6"/>
  100. <path fill="#333333" d="m 19,8 c -4,0 -6,2 -6,4 0,1 0,3 0,3 0,0 -1,0 -2,0 0,2 0,5 0,8 0,2 2,3 4,3 3,0 5,0 8,0 1,0 3,-1 3,-3 0,-3 0,-5 0,-8 -1,0 -2,0 -2,0 l 0,-3 C 24,9 21,8 19,8 z m 3,5 0,2 -7,0 c 0,-3 0,-2 0,-2 0,-2 1,-3 4,-3 1,0 3,1 3,3 z m -3,4 c 1,0 2,2 0,3 l 1,4 -3,0 1,-4 c -2,-1 -1,-3 1,-3 z"/>'
  101. else
  102. PIXLOCK=''
  103. fi
  104. echo '
  105. <svg version="1.0" width="350" height="60" id="svg1"
  106. xmlns:xlink="http://www.w3.org/1999/xlink">
  107. <defs
  108. id="defs4">
  109. <linearGradient id="LGD_01">
  110. <stop style="stop-color:#47808E;stop-opacity:1" offset="0" />
  111. <stop style="stop-color:#47808E;stop-opacity:0" offset="1" />
  112. </linearGradient>
  113. <linearGradient id="LG_01"
  114. x1="-10" y1="-40" x2="20" y2="80"
  115. xlink:href="#LGD_01"
  116. gradientUnits="userSpaceOnUse" />
  117. </defs>
  118. <rect
  119. style="fill:url(#LG_01);fill-opacity:1;fill-rule:evenodd;stroke-width:0;stroke:#404040;stroke-opacity:1;stroke-dasharray:none;"
  120. width="350" height="60"/>
  121. <image xlink:href="'${ICON}'" width="48" height="48" x="5" y="5"/>
  122. '"$PIXLOCK"'
  123. <text
  124. style="fill:#366570;stroke:none;font-family:DejaVu;font-style:normal;font-weight:medium;font-size:16;fill-opacity:1;stroke-opacity:1;stroke-width:3pt;stroke-linejoin:miter;stroke-linecap:butt;text-anchor:start;writing-mode:lr;"
  125. x="75" y="20">
  126. '${ONEDISKDESCR}'
  127. </text>
  128. <text
  129. style="fill:#366570;stroke:none;font-family:DejaVu;font-style:normal;font-weight:medium;font-size:12;fill-opacity:1;stroke-opacity:1;stroke-width:3pt;stroke-linejoin:miter;stroke-linecap:butt;text-anchor:start;writing-mode:lr;"
  130. x="75" y="40">
  131. '$PARTSIZE'
  132. </text>
  133. </svg>' > /tmp/pmount_${ONEDISKNAME}_svg
  134. }
  135. buildpix (){
  136. ONEPART="$1"
  137. ONEDEV="$2"
  138. ONECATEGORY="$3"
  139. DEVPATTERN="^${ONEDEV} "
  140. ONEMNTPT="`mount | grep "$DEVPATTERN" | cut -f 3 -d ' '`"
  141. DEVNAME="`echo -n "$ONEDEV" | cut -f 3 -d '/'`"
  142. #size
  143. if [ "$ONEFS" != "cdda" ]; then
  144. export ONESIZEK=`echo -n "$ONEPART" | cut -f 3 -d '|'`
  145. [ "$ONESIZEK" = 0 ] && ONESIZEK=1 #calculation of percent (svg) fails if size is 0 (ie. a blank CD)
  146. if [ $ONESIZEK -gt 1073741824 ];then #1024*1024*1024
  147. ONESIZE="`dc $ONESIZEK 1073741824 \/ p`"
  148. ONESIZE="`printf "%.1f" $ONESIZE`T"
  149. elif [ $ONESIZEK -gt 1048576 ];then #1024*1024
  150. ONESIZE="`dc $ONESIZEK 1048576 \/ p`"
  151. ONESIZE="`printf "%.1f" $ONESIZE`G"
  152. else
  153. if [ $ONESIZEK -gt 99 ];then
  154. ONESIZE="`expr $ONESIZEK \/ 1024`M"
  155. else
  156. ONESIZE="`dc $ONESIZEK 1024 \/ p`"
  157. ONESIZE="`printf "%.1f" $ONESIZE`M"
  158. fi
  159. fi
  160. if [ "$ONESIZE" = "0.0M" ] || [ "$ONESIZE" = "0M" ]; then ONESIZE=""; fi
  161. fi
  162. #free space
  163. if [ ! "$ONEMNTPT" ]; then
  164. FREEK=$ONESIZEK
  165. export PIXTEXT="${ONESIZE}"
  166. else
  167. export FREEK=`df -k | tr -s ' ' | grep -m1 "$DEVPATTERN" | cut -f 4 -d ' '`
  168. [ ! "$FREEK" ] && FREEK=$ONESIZEK
  169. if [ $FREEK -gt 1073741824 ];then #1024*1024*1024
  170. ONEFREE="`dc $FREEK 1073741824 \/ p`"
  171. ONEFREE="`printf "%.1f" $ONEFREE`T"
  172. elif [ $FREEK -gt 1048576 ];then #1024*1024
  173. ONEFREE="`dc $FREEK 1048576 \/ p`"
  174. ONEFREE="`printf "%.1f" $ONEFREE`G"
  175. else
  176. if [ $FREEK -gt 99 ];then
  177. ONEFREE="`expr $FREEK \/ 1024`M"
  178. else
  179. ONEFREE="`dc $FREEK 1024 \/ p`"
  180. ONEFREE="`printf "%.1f" $ONEFREE`M"
  181. fi
  182. fi
  183. if [ "$ONEFREE" = "0.0M" ] || [ "$ONEFREE" = "0M" ]; then ONEFREE=""; fi
  184. export PIXTEXT="${ONESIZE} / ${ONEFREE}"
  185. fi
  186. if [ "$ONECATEGORY" != "optical" ]; then
  187. /usr/lib/gtkdialog/svg_bar 120 "$((($ONESIZEK-$FREEK)*120/$ONESIZEK))" "$PIXTEXT" > /tmp/pmount${DEVNAME}_svg
  188. else
  189. /usr/lib/gtkdialog/svg_bar 120 0 "$(gettext 'N/A')" > /tmp/pmount${DEVNAME}_svg
  190. fi
  191. }
  192. volumelabel (){
  193. DODEV="$1"
  194. DEVNAME="`echo -n "$DODEV" | cut -f 3 -d '/'`"
  195. export inputbox='
  196. <window title="pMount - '$(gettext 'Puppy Drive Mounter')'">
  197. <vbox>
  198. <frame '$(gettext 'Edit label')' - '$DODEV'>
  199. <entry activates-default="true">
  200. <variable>VOLUME_LABEL</variable>
  201. <input>cat /tmp/pmount_'${DEVNAME}'_LABEL</input>
  202. </entry>
  203. </frame>
  204. <hbox>
  205. <button>
  206. '"`/usr/lib/gtkdialog/xml_button-icon cancel`"'
  207. <label>'$(gettext 'Cancel')'</label>
  208. <action type="exit">cancel</action>
  209. </button>
  210. <button can-default="true" has-default="true" use-stock="true">
  211. '"`/usr/lib/gtkdialog/xml_button-icon ok`"'
  212. <label>'$(gettext 'Ok')'</label>
  213. <action type="exit">OK</action>
  214. </button>
  215. </hbox>
  216. </vbox>
  217. </window>'
  218. I=$IFS; IFS=""
  219. for STATEMENTS in $(gtkdialog -p inputbox --center); do
  220. eval $STATEMENTS
  221. done
  222. IFS=$I
  223. if [ $EXIT = OK ]; then
  224. e2label $DODEV "$VOLUME_LABEL"
  225. echo "$VOLUME_LABEL" > /tmp/pmount_${DEVNAME}_LABEL
  226. fi
  227. }
  228. mountme (){
  229. DODEV="`echo -n "$1" | cut -f 2 -d '_'`"
  230. DEVNAME="`echo -n "$DODEV" | cut -f 3 -d '/'`"
  231. DOFS="`echo -n "$1" | cut -f 3 -d '_'`"
  232. devPATTERN='^'"$DEVNAME"'|'
  233. TOPACTUAL="`echo "$DEV2TAB" | tr ' ' '\n' | grep "$devPATTERN" | cut -f 2 -d '|'`" #find top tab.
  234. if [ "`echo "$1" | grep -F 'DOMOUNT'`" ];then
  235. mkdir -p /mnt/$DEVNAME
  236. case $DOFS in
  237. ntfs)
  238. #'mount' is a script that takes care of mounting ntfs... 100127...
  239. mount -t ntfs $DODEV /mnt/$DEVNAME
  240. RETVAL1=$?
  241. ;;
  242. vfat)
  243. NLS_PARAM=""
  244. if [ -f /etc/codepage ]; then #100127...
  245. grep -q '850' /etc/codepage && [ "$(echo $LANG|cut -d'.' -f1)" != "en_US" ] && NLS_PARAM=",codepage=850"
  246. grep -q '852' /etc/codepage && NLS_PARAM=",codepage=852,iocharset=iso8859-2"
  247. fi
  248. echo $LANG | grep -q -i '\.utf' && NLS_PARAM="$NLS_PARAM,utf8"
  249. mount -t vfat -o shortname=mixed,quiet$NLS_PARAM $DODEV /mnt/$DEVNAME #v411 added quiet.
  250. RETVAL1=$?
  251. ;;
  252. #100127 not certain about this (inserted by shinobar)... 100131 shinobar informs needed for cds created in windows...
  253. iso9660|udf) #130128 add udf.
  254. mount -t $DOFS -o iocharset=utf8 $DODEV /mnt/$DEVNAME
  255. RETVAL1=$?
  256. ;;
  257. *)
  258. mount -t $DOFS $DODEV /mnt/$DEVNAME
  259. RETVAL1=$?
  260. ;;
  261. esac
  262. if [ $RETVAL1 -eq 0 ]; then
  263. #v3.95 -x option to rescan...
  264. exec rox -x /mnt/$DEVNAME -d /mnt/$DEVNAME #want this window on top.
  265. else
  266. pupmessage -bg red -center -title "pMount - $(gettext 'Puppy Drive Mounter')" "$(eval_gettext "ERROR: unable to mount \$DEVNAME")"
  267. exec /tmp/pmount_reload
  268. fi
  269. else
  270. MNTPT="`echo -n "$1" | cut -f 4 -d '_'`"
  271. [ ! "$MNTPT" ] && MNTPT=/mnt/$DEVNAME
  272. rox -D $MNTPT
  273. sync
  274. umount $DODEV ; umVAL=$?
  275. #v3.99 fix zombie process prevents partition unmount, invisible to fuser...
  276. if [ $umVAL -ne 0 ];then
  277. #120129 karl godt: fix ZOMBIES, see http://murga-linux.com/puppy/viewtopic.php?t=71767&start=420 ...
  278. ZOMBIES="`ps -H -A | grep '<defunct>' | sed 's/^[[:blank:]]*//;s/ /|/g' | grep -v '|||' | cut -f 1 -d ' ' | tr '\n' ' '`"
  279. for ONEZOMBIE in $ZOMBIES; do
  280. echo "Killing parentless zombie process $ONEZOMBIE"
  281. kill $ONEZOMBIE
  282. done
  283. umount $DODEV ; umVAL=$?
  284. fi
  285. #v3.99 rare ocassion, partition got unmounted before umount runs above...
  286. umPATTERN="${MNTPT} "
  287. [ "`mount | grep "$umPATTERN"`" = "" ] && umVAL=0
  288. if [ $umVAL -ne 0 ];then
  289. EXTRAMSG0="`fuser -v -m $MNTPT`"
  290. if [ "$EXTRAMSG0" = "" ];then
  291. m_30="$(gettext 'FAILURE! In the case of removable media, the most
  292. common reason is the media is not currently inserted.
  293. If so, please remedy.')"
  294. pupmessage -bg "#ff8080" -title "pMount - $(gettext 'Puppy Drive Mounter')" -center "$m_30"
  295. else
  296. gxmessage -wrap -bg "#ff99ff" -title "pMount - $(gettext 'Puppy Drive Mounter')" -center -buttons "$(gettext 'KILL')":10,"$(gettext 'EXIT')":20 "$(gettext 'FAILURE!')
  297. $(gettext 'One or more processes (programs) are currently
  298. using the partition. Here they are:')
  299. ${EXTRAMSG0}
  300. $(gettext "If you press the 'KILL' button, Puppy will attempt to
  301. kill the offending programs for you. Only do this as a
  302. last resort.")
  303. $(gettext "Firstly you should try to close the programs
  304. manually, so do not press 'KILL'.")
  305. $(gettext "PLEASE PRESS THE 'EXIT' BUTTON!")"
  306. [ $? -eq 10 ] && fuser -k -m $MNTPT
  307. fi
  308. exec /tmp/pmount_reload
  309. else
  310. if [ "$DOFS" = "iso9660" ]; then
  311. eject $DODEV
  312. /usr/lib/gtkdialog/box_ok "pMount - $(gettext 'Puppy Drive Mounter')" info "$(gettext 'Remove media, then press <b>Ok</b>')"
  313. eject -t $DODEV
  314. exec /tmp/pmount_reload
  315. fi
  316. fi
  317. fi
  318. }
  319. writeconfig (){
  320. XWININFO=`xwininfo -stats -name pMount`
  321. HEIGHT=`echo "$XWININFO" | grep 'Height:' | awk '{print $2}'`
  322. WIDTH=`echo "$XWININFO" | grep 'Width:' | awk '{print $2}'`
  323. X1=`echo "$XWININFO" | grep 'Absolute upper-left X' | awk '{print $4}'`
  324. Y1=`echo "$XWININFO" | grep 'Absolute upper-left Y' | awk '{print $4}'`
  325. X2=`echo "$XWININFO" | grep 'Relative upper-left X' | awk '{print $4}'`
  326. Y2=`echo "$XWININFO" | grep 'Relative upper-left Y' | awk '{print $4}'`
  327. X=$(($X1-$X2))
  328. Y=$(($Y1-$Y2))
  329. #---
  330. echo "#pMount config" > $HOME/.pmountrc
  331. echo "export COLOR_SPACEFREE='#3FA04E'" >> $HOME/.pmountrc
  332. echo "export COLOR_SPACEUSED='#D7302A'" >> $HOME/.pmountrc
  333. echo "export COLOR_SPACELOCKED='#EDBF4D'" >> $HOME/.pmountrc
  334. echo -e "\n#Geometry" >> $HOME/.pmountrc
  335. echo "export HEIGHT=\"$HEIGHT\"" >> $HOME/.pmountrc
  336. echo "export WIDTH=\"$WIDTH\"" >> $HOME/.pmountrc
  337. echo "export X=\"$X\"" >> $HOME/.pmountrc
  338. echo "export Y=\"$Y\"" >> $HOME/.pmountrc
  339. }
  340. export -f buildheading buildpix volumelabel mountme writeconfig
  341. ###################################################################################
  342. # #
  343. # P R O G R A M #
  344. # #
  345. ###################################################################################
  346. /usr/lib/gtkdialog/box_splash -close never -fontsize large -text "$(gettext 'Please wait, probing hardware...')" & #110720
  347. X1PID=$!
  348. #v4.01 passed param, choose which tab to be "on top"...
  349. TOPTAB=''
  350. if [ $1 ];then
  351. TOPTAB="$1" #also allow full tab names usbdrv,optical,drive,card,floppy to be passed.
  352. [ "$1" = "any" ] && TOPTAB="drive" #see pup_eventd
  353. #pup_eventd calls pmount with just two letters...
  354. [ "$1" = "sd" ] && TOPTAB="usbdrv"
  355. [ "$1" = "sr" ] && TOPTAB="optical"
  356. [ "$1" = "mm" ] && TOPTAB="card"
  357. [ "$1" = "fd" ] && TOPTAB="floppy"
  358. fi
  359. PROBEPART="probepart"
  360. PROBEDISK="probedisk"
  361. #v4.01 toggle tabbed interface...
  362. SINGLEFLAG="true" #default tabbed interface.
  363. [ -f /root/.pmountsingle ] && SINGLEFLAG="`cat /root/.pmountsingle`"
  364. #v4.02 quit immediately after choosing to mount/umount a partition... v404 change to false
  365. PMOUNTQUIT="false" #"true" v404 change to false
  366. [ -f /root/.pmountquit ] && PMOUNTQUIT="`cat /root/.pmountquit`"
  367. #but if starting pmount from menu or 'drives' icon, do not quit...
  368. [ "$1" = "any" -o "$1" = "" ] && PMOUNTQUIT="false"
  369. #v3.96 'mount' misreports which partition mounted on '/'...
  370. ROOTDEV2=""
  371. [ "$PUPMODE" = "2" ] && ROOTDEV2="`df | grep ' /$' | grep '^/dev/' | cut -f 1 -d ' '`"
  372. DISKINFO="`$PROBEDISK | sort -k 2 --field-separator='|'`" #v4.01
  373. PARTSINFO="`$PROBEPART -k | grep -v 'none' | tr ' ' '_' | tr '\t' '_' | cut -f 1-3 -d '|'`" #v3.98 fix for mut2.
  374. #add floppy drive, if any (note, zip detected by probedisk/probepart)...
  375. if [ -e /sys/block/fd0 ];then
  376. DISKINFO="/dev/fd0|floppy|floppy disk drive
  377. $DISKINFO"
  378. PARTSINFO="/dev/fd0|vfat|1440
  379. $PARTSINFO"
  380. fi
  381. #v4.01 reorganise so that a particular tab is on top...
  382. if [ "$TOPTAB" != "" ];then
  383. toptabPATTERN='|'"$TOPTAB"'|'
  384. TOPDISKS="`echo "$DISKINFO" | grep "$toptabPATTERN"`"
  385. if [ "$TOPDISKS" != "" ];then
  386. DISKINFO="${TOPDISKS}
  387. `echo "$DISKINFO" | grep -v "$toptabPATTERN"`"
  388. fi
  389. fi
  390. #v410 catch case no valid partitions/drvs in a category, remove that category...
  391. echo -n "" > /tmp/pmount_cat_test1
  392. for ONEDISK in `echo "$DISKINFO" | cut -f 1,2 -d '|' | tr '\n' ' '`
  393. do
  394. ONEDRVNAME="`echo -n "$ONEDISK" | cut -f 1 -d '|'`"
  395. ONEDRVCAT="`echo -n "$ONEDISK" | cut -f 2 -d '|'`"
  396. if [ "`echo "$PARTSINFO" | grep "$ONEDRVNAME" | grep -v '|none|'`" != "" ];then
  397. echo "$ONEDRVCAT" >> /tmp/pmount_cat_test1
  398. fi
  399. done
  400. for ONECAT in `echo "$DISKINFO" | cut -f 2 -d '|' | sort -u | tr '\n' ' '`
  401. do
  402. if [ "`grep "$ONECAT" /tmp/pmount_cat_test1`" = "" ];then
  403. diPATTERN="|${ONECAT}|"
  404. NEWDISKINFO="`echo "$DISKINFO" | grep -v "$diPATTERN"`"
  405. DISKINFO="$NEWDISKINFO"
  406. fi
  407. done
  408. #v4.01 find the tabs...
  409. #old probedisk has: cdrom, disk, floppy, Direct-Access.
  410. #probedisk2 has: drive, optical, usbdrv, card, floppy
  411. TABLIST="`echo -n "$DISKINFO" | cut -f 2 -d '|' | uniq | tr '\n' '|' | sed -e 's/|$//'`"
  412. CURRENTTAB=''
  413. #v408 v410 moved up... 130216 added f2fs...
  414. VALIDPARTS="`echo "$PARTSINFO" | grep -E 'btrfs|ext2|ext3|ext4|f2fs|hfs|iso9660|jfs|minix|msdos|ntfs|reiser|udf|vfat|xfs'`" #130128
  415. #get actual top tab...
  416. TOPACTUAL="`echo "$TABLIST" | cut -f 1 -d '|'`"
  417. #v4.01 PARTSINFO has to be sorted in same order as the categories in DISKINFO...
  418. PARTSGUI=""
  419. FRAMEFLAG="off"
  420. export DEV2TAB=""
  421. OLDDISKNAME=''
  422. for ONEDISK in `echo "$DISKINFO" | cut -f 1 -d '|' | tr '\n' ' '`
  423. do
  424. #v408 bug fix, a drive with no valid partitions, skip it...
  425. [ "`echo "$VALIDPARTS" | grep "$ONEDISK"`" = "" ] && continue
  426. ONEDISKNAME="`echo "$ONEDISK" | cut -f 3 -d '/'`"
  427. DSKPATTERN="^${ONEDISK}|"
  428. ONEDISKDESCR="`echo "$DISKINFO" | grep "$DSKPATTERN" | cut -f 3 -d '|' | tr '\-' '@' | sed -e 's/[^a-zA-Z0-9 @_]//g' | tr '@' '-'`"
  429. xDSKPATTERN="^${ONEDISK}"
  430. cutPARTSINFO="`echo "$PARTSINFO" | grep "$xDSKPATTERN" | tr '\n' ' '`"
  431. [ "$cutPARTSINFO" = "" ] && continue #fix for superfloppy-drv with unknown f.s.
  432. [ "$cutPARTSINFO" = " " ] && continue #v408 er, there will be a single space.
  433. #group one or more frames in same tab...
  434. ONECATEGORY="`echo "$DISKINFO" | grep "$DSKPATTERN" | cut -f 2 -d '|'`" #drive,optical,usbdrv,card,floppy
  435. if [ "$CURRENTTAB" = "" ];then
  436. PARTSGUI="${PARTSGUI}<vbox scrollable=\"true\">"
  437. TABFLAG="on"
  438. else
  439. [ "$CURRENTTAB" != "$ONECATEGORY" ] && PARTSGUI="${PARTSGUI}</vbox><vbox scrollable=\"true\">"
  440. fi
  441. CURRENTTAB="$ONECATEGORY"
  442. buildheading ${ONEDISK} ${ONECATEGORY} "${ONEDISKDESCR}"
  443. PARTSGUI="${PARTSGUI}
  444. <vbox spacing=\"0\">
  445. <hbox space-expand=\"false\" space-fill=\"false\">
  446. <pixmap space-expand=\"false\" space-fill=\"false\"><variable>PIX_DISK_${ONEDISKNAME}</variable><input file>/tmp/pmount_${ONEDISKNAME}_svg</input></pixmap>
  447. <hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
  448. </hbox>"
  449. ###############################################################################
  450. for ONEPART in $cutPARTSINFO
  451. do
  452. ONEDEV="`echo -n "$ONEPART" | cut -f 1 -d '|'`"
  453. DEVNAME="`echo -n "$ONEDEV" | cut -f 3 -d '/'`"
  454. export DEV2TAB="${DEV2TAB} ${DEVNAME}|${CURRENTTAB}" #remember which tab a partition is in.
  455. ONEFS="`echo -n "$ONEPART" | cut -f 2 -d '|'`"
  456. DEVPATTERN="${ONEDEV} "
  457. ONEMNTPT="`grep "$DEVPATTERN" /proc/self/mountinfo | grep '/ ' | cut -f 5 -d ' '`"
  458. [ "$ROOTDEV2" != "" ] && [ "$ROOTDEV2" = "$ONEDEV" ] && ONEMNTPT='/' #v3.96
  459. #in some cases prevent unmounting...
  460. INVISBUT=""
  461. if [ "`echo -n "$ONEMNTPT" | grep '^/initrd'`" -o "$ONEMNTPT" = "/" ]; then INVISBUT='<visible>disabled</visible>'; fi
  462. #v404 unipup, cannot unmount anything mntd in /.mnt...
  463. case $PUPMODE in
  464. 16|24|17|25)
  465. [ "`echo -n "$ONEMNTPT" | grep '^/\.mnt'`" ] && INVISBUT='<visible>disabled</visible>'
  466. #usr_xxx.sfs was not copied to ram, still on partition...
  467. [ "`losetup | grep -o ' /.*/usr_.*\.sfs' | cut -f 1-3 -d '/' | cut -f 2 -d ' '`" = "$ONEMNTPT" ] && INVISBUT='<visible>disabled</visible>'
  468. ;;
  469. esac
  470. #if 'home' partition, substitute /mnt/home...
  471. if [ -L /mnt/home -a "`echo "$ONEMNTPT" | grep '/initrd/'`" != "" ];then
  472. HOMELINK="`readlink /mnt/home`"
  473. [ "$HOMELINK" = "$ONEMNTPT" ] && ONEMNTPT="/mnt/home"
  474. fi
  475. #110720 should not open a layer inside aufs, ex: session saved entire partition, desktop drive icon is /initrd/pup_rw...
  476. case $ONEMNTPT in
  477. /initrd/pup_*)
  478. ONEMNTPT="/" #open rox at top of aufs layers.
  479. ;;
  480. esac
  481. #define volume label and action menu/button
  482. echo '' > /tmp/pmount_${DEVNAME}_LABEL
  483. INVISLABEL=true
  484. MENU_BOOTMOUNT=false
  485. [ ! "`echo $ONEFS | grep -F ext`" ] && INVISLABEL=false
  486. if [ ! "$ONEMNTPT" ]; then
  487. INVISSHOWLOC=false
  488. INVISPIX=false
  489. INVISFILECHK=true
  490. echo false > /tmp/pmount_${DEVNAME}_domount
  491. else
  492. INVISSHOWLOC=true
  493. INVISPIX=true
  494. INVISFILECHK=false
  495. echo true > /tmp/pmount_${DEVNAME}_domount
  496. fi
  497. ACTION_MENU="
  498. <menuitem label=\"$(gettext 'Show location')\" stock=\"gtk-open\">
  499. <variable>MENU_SHOWLOC_${DEVNAME}</variable>
  500. <sensitive>${INVISSHOWLOC}</sensitive>
  501. <action>rox -d ${ONEMNTPT} &</action>
  502. </menuitem>"
  503. if [ "$ONEFS" != "iso9660" ];then
  504. #check if patrition is mounted at boot
  505. [ "`grep "^mkdir -p /mnt/${DEVNAME}; mount" /etc/rc.d/rc.local | grep -F '#pmount'`" ] && MENU_BOOTMOUNT=true
  506. #---
  507. ACTION_MENU="$ACTION_MENU
  508. <menuitemseparator></menuitemseparator>
  509. <menuitem label=\"$(gettext 'Edit label')\" stock=\"gtk-edit\">
  510. <sensitive>${INVISLABEL}</sensitive>
  511. <action>volumelabel ${ONEDEV}</action>
  512. <action>refresh:LABEL_${DEVNAME}</action>
  513. </menuitem>
  514. <menuitem label=\"$(gettext 'Check filesystem')\" stock=\"gtk-find\">
  515. <variable>MENU_FILECHK_${DEVNAME}</variable>
  516. <sensitive>${INVISFILECHK}</sensitive>
  517. <action>rxvt --hold --title \"pMount - $(gettext 'Puppy Drive Mounter')\" -geometry 80x10 -bg black -fg green -e fsck -Cv \"$ONEDEV\"</action>
  518. </menuitem>
  519. <menuitemseparator></menuitemseparator>
  520. <menuitem checkbox=\"$MENU_BOOTMOUNT\" label=\"$(gettext 'Mount partition at boot')\">
  521. <variable>MENU_BOOTMOUNT_${DEVNAME}</variable>
  522. ${INVISBUT}
  523. <action>cp -f /etc/rc.d/rc.local /tmp/pmount_tmp</action>
  524. <action>if false grep -v '${DEVNAME} #pmount' /tmp/pmount_tmp > /etc/rc.d/rc.local</action>
  525. <action>if true echo 'mkdir -p /mnt/${DEVNAME}; mount -t $ONEFS $ONEDEV /mnt/$DEVNAME #pmount' >> /etc/rc.d/rc.local</action>
  526. </menuitem>"
  527. fi
  528. BUTTON="
  529. <checkbox draw_indicator=\"false\">
  530. <variable>BUTTON_${DEVNAME}</variable>
  531. <label>$(gettext '(un) Mount')</label>
  532. <default>$(</tmp/pmount_${DEVNAME}_domount)</default>
  533. <input>cat /tmp/pmount_${DEVNAME}_domount</input>
  534. ${INVISBUT}
  535. <action>if false mountme UNMOUNT_${ONEDEV}_${ONEFS}_${ONEMNTPT}</action>
  536. <action>if false disable:PIX_${DEVNAME}</action>
  537. <action>if false disable:MENU_SHOWLOC_${DEVNAME}</action>
  538. <action>if false enable:MENU_FILECHK_${DEVNAME}</action>
  539. <action>if true mountme DOMOUNT_${ONEDEV}_${ONEFS}</action>
  540. <action>if true enable:PIX_${DEVNAME}</action>
  541. <action>if true enable:MENU_SHOWLOC_${DEVNAME}</action>
  542. <action>if true disable:MENU_FILECHK_${DEVNAME}</action>
  543. <action>if true buildpix \"${ONEPART}\" ${ONEDEV} ${ONECATEGORY}</action>
  544. <action>if true refresh:PIX_${DEVNAME}</action>
  545. <action>buildheading ${ONEDISK} ${ONECATEGORY} \"${ONEDISKDESCR}\"</action>
  546. <action>refresh:PIX_DISK_${ONEDISKNAME}</action>
  547. </checkbox>"
  548. case "$ONEFS" in
  549. ntfs)
  550. if [ "`ntfslabel -f $ONEDEV 2> /dev/null`" ]; then ntfslabel -f $ONEDEV 2> /dev/null > /tmp/pmount_${DEVNAME}_LABEL; fi
  551. ;;
  552. iso9660)
  553. if [ "`cddetect | grep -F 'cdtype: audio'`" ]; then
  554. echo 'CD-Audio' > /tmp/pmount_${DEVNAME}_LABEL
  555. ACTION_MENU="<menuitem label=\"$(gettext 'Play')\" stock=\"gtk-media-play\"><action>defaultcdplayer &</action></menuitem>
  556. <menuitemseparator></menuitemseparator>
  557. <menuitem label=\"$(gettext 'Eject disc')\" stock=\"gtk-cdrom\"><action>eject ${ONEDEV} &</action><action type=\"exit\">REFRESH</action></menuitem>"
  558. ONEFS=cdda
  559. ONESIZE=74min
  560. BUTTON="<button><label>$(gettext '(un) Mount')</label><sensitive>false</sensitive></button>"
  561. INVISPIX=true
  562. else
  563. ACTION_MENU="${ACTION_MENU}
  564. <menuitemseparator></menuitemseparator>"
  565. [ "`pburn --help | grep -A10 -F '[MODE]' | grep -F info`" ] && ACTION_MENU="${ACTION_MENU}<menuitem label=\"$(gettext 'Disc information')\" stock=\"gtk-info\"><action>pburn -m info &</action></menuitem>"
  566. ACTION_MENU="${ACTION_MENU}
  567. <menuitem label=\"$(gettext 'Play') Video-DVD\" stock=\"gtk-media-play\"><action>defaultmediaplayer dvd:// &</action></menuitem>
  568. <menuitemseparator></menuitemseparator>
  569. <menuitem label=\"$(gettext 'Eject disc')\" stock=\"gtk-cdrom\"><action>eject ${ONEDEV} &</action><action type=\"exit\">REFRESH</action></menuitem>"
  570. [ "$ONEMNTPT" ] && INVISPIX=true
  571. fi
  572. ;;
  573. vfat)
  574. if [ `mlabel -i $ONEDEV -s :: 2> /dev/null | cut -d " " -f 4` ]; then mlabel -i $ONEDEV -s :: 2> /dev/null | cut -d " " -f 5 > /tmp/pmount_${DEVNAME}_LABEL; fi
  575. ;;
  576. ext*)
  577. e2label $ONEDEV 2> /dev/null > /tmp/pmount_${DEVNAME}_LABEL
  578. ;;
  579. swap)
  580. echo Memory > /tmp/pmount_${DEVNAME}_LABEL
  581. export PIXTEXT="${ONESIZE}"
  582. BUTTON="<button><label>$(gettext '(un) Mount')</label><sensitive>false</sensitive></button>"
  583. if [ "`grep -Fw "$ONEDEV" /proc/swaps`" ]; then
  584. ACTION_MENU="<menuitem label=\"$(gettext 'Swap off')\" stock=\"gtk-no\"><action>swapoff $ONEDEV</action><action type=\"exit\">REFRESH</action></menuitem>"
  585. INVISPIX=true
  586. else
  587. ACTION_MENU="<menuitem label=\"$(gettext 'Swap on')\" stock=\"gtk-yes\"><action>swapon $ONEDEV</action><action type=\"exit\">REFRESH</action></menuitem>"
  588. fi
  589. ;;
  590. esac
  591. buildpix "${ONEPART}" ${ONEDEV} ${ONECATEGORY}
  592. PARTSGUI="${PARTSGUI}
  593. <hbox height-request=\"22\">
  594. <menubar><menu label=\"${DEVNAME}\" stock=\"gtk-arrow_down\">$ACTION_MENU</menu></menubar>
  595. <text space-expand=\"false\" space-fill=\"false\"><variable>LABEL_${DEVNAME}</variable><input>cat /tmp/pmount_${DEVNAME}_LABEL</input></text>"
  596. [ "$INVISBUT" ] && PARTSGUI="${PARTSGUI}<pixmap space-expand=\"false\" space-fill=\"false\"><input file>/usr/share/pixmaps/puppy/puppy.svg</input><height>20</height></pixmap>"
  597. PARTSGUI="${PARTSGUI}
  598. <hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
  599. <text><label>${ONEFS}</label></text>
  600. <vbox spacing=\"0\">
  601. <text height-request=\"2\"><label>\"\"</label></text>
  602. <pixmap><variable>PIX_${DEVNAME}</variable><sensitive>$INVISPIX</sensitive><input file>/tmp/pmount${DEVNAME}_svg</input></pixmap>
  603. </vbox>
  604. $BUTTON
  605. </hbox>
  606. <text height-request=\"2\"><label>\"\"</label></text>"
  607. done
  608. ########################################################################
  609. PARTSGUI="${PARTSGUI}
  610. <text height-request=\"15\"><label>\"\"</label></text>
  611. </vbox>"
  612. OLDDISKNAME="$ONEDISKNAME"
  613. done
  614. if [ "$TABFLAG" = "on" ];then #v4.01
  615. PARTSGUI="${PARTSGUI}</vbox>"
  616. fi
  617. PREFSBUTTON='
  618. <button space-expand="false" space-fill="false">
  619. '"`/usr/lib/gtkdialog/xml_button-icon preferences`"'
  620. <action type="exit">SETPREFS</action>
  621. </button>'
  622. m_03="$(gettext 'drive')"
  623. m_04="$(gettext 'usbdrv')"
  624. m_05="$(gettext 'optical')"
  625. m_06="$(gettext 'card')"
  626. m_07="$(gettext 'floppy')"
  627. M_TABLIST=$(echo $TABLIST|sed -e "s/drive/$m_03/" -e "s/usbdrv/$m_04/" -e "s/optical/$m_05/" -e "s/card/$m_06/" -e "s/floppy/$m_07/")
  628. if [ "$SINGLEFLAG" = "false" ];then #default
  629. NOTEBOOKHEAD="<notebook space-expand=\"true\" space-fill=\"true\" labels=\"${M_TABLIST}\">"
  630. NOTEBOOKTAIL="</notebook>"
  631. else
  632. NOTEBOOKHEAD="<vbox scrollable=\"true\">"
  633. NOTEBOOKTAIL="</vbox>"
  634. PARTSGUI="`echo "$PARTSGUI" | sed 's/ scrollable="true"//g'`"
  635. fi
  636. export PMOUNTGUI='
  637. <window title="pMount" icon-name="gtk-harddisk" default_height="'$HEIGHT'" default_width="'$WIDTH'">
  638. <vbox>
  639. '${NOTEBOOKHEAD}'
  640. '${PARTSGUI}'
  641. <hbox homogeneous="true" space-expand="true" space-fill="true">
  642. <text use-markup="true" space-expand="true" space-fill="true"><label>"<span fgcolor='"'#821811'"'><b>'$(gettext 'DO NOT REMOVE MOUNTED MEDIA')'</b></span>"</label></text>
  643. </hbox>
  644. '${NOTEBOOKTAIL}'
  645. <hbox space-expand="false" space-fill="false">
  646. <button space-expand="false" space-fill="false">
  647. '"`/usr/lib/gtkdialog/xml_button-icon refresh`"'
  648. <label>'$(gettext 'Refresh')'</label>
  649. <action>writeconfig</action>
  650. <action type="exit">REFRESH</action>
  651. </button>
  652. '${PREFSBUTTON}'
  653. <button space-expand="false" space-fill="false">
  654. '"`/usr/lib/gtkdialog/xml_button-icon quit`"'
  655. <action>writeconfig</action>
  656. <action type="exit">EXIT</action>
  657. </button>
  658. '"`/usr/lib/gtkdialog/xml_scalegrip`"'
  659. </hbox>
  660. </vbox>
  661. <action signal="delete-event">writeconfig</action>
  662. </window>'
  663. echo "$PMOUNTGUI" > /tmp/pmountdlg.txt_${MYPID}
  664. kill $X1PID
  665. #gtk theme
  666. echo 'pixmap_path "/usr/share/pixmaps/puppy/"
  667. style "pmount"
  668. { stock["gtk-arrow_down"] = {{ "arrow_mini_down.svg", *, *, *}}
  669. GtkStatusbar::shadow_type = GTK_SHADOW_NONE }
  670. class "GtkWidget" style "pmount"' > /tmp/gtkrc_pmount
  671. export GTK2_RC_FILES=/tmp/gtkrc_pmount:$HOME/.gtkrc-2.0
  672. #v4.01...
  673. [ ! -e /tmp/gtkdialog_pmount ] && ln -s /usr/sbin/gtkdialog /tmp/gtkdialog_pmount
  674. /tmp/gtkdialog_pmount --file=/tmp/pmountdlg.txt_${MYPID} -G +"$X"+"$Y" >/tmp/pmountdlg_${MYPID} 2>/tmp/pmounterr
  675. ###################################################################################
  676. # #
  677. # P O S T O P E R A T O I N S #
  678. # #
  679. ###################################################################################
  680. #[ -s /tmp/pmounterr ] && exit
  681. #v412, no, do not exit if only a warning error msg...
  682. if [ -s /tmp/pmounterr ];then
  683. #w477 running Xvesa: 'Xlib: extension "Generic Event Extension" missing on display ":0.0".'
  684. [ "`grep -v -E 'WARNING|Generic Event Extension' /tmp/pmounterr`" != "" ] && exit
  685. fi
  686. rm -f /tmp/pmountdlg.txt_${MYPID}
  687. #if gui killed by pup_eventd, then file will be empty. restart pmount...
  688. if [ ! -s /tmp/pmountdlg_${MYPID} ];then
  689. rm -f /tmp/pmountdlg_${MYPID}
  690. exit
  691. fi
  692. RETPARAMS="`cat /tmp/pmountdlg_${MYPID}`"
  693. eval "$RETPARAMS"
  694. [ "$EXIT" = "REFRESH" ] && exec /usr/sbin/$PMOUNT $TOPACTUAL
  695. if [ "$EXIT" = "SETPREFS" ];then
  696. DLGSETENG='
  697. <window title="pMount - '$(gettext 'Preferences')'">
  698. <vbox space-expand="true" space-fill="true">
  699. <frame '$(gettext 'Preferences')'>
  700. <text xpad="10" xalign="0" space-expand="true" space-fill="true"><label>'$(gettext "If you don't have many drives or partitions, you may find it more convenient to see everything in one window. Untick the box if you want the default tabbed interface, or tick for a single window.")'</label></text>
  701. <checkbox>
  702. <label>'$(gettext 'Tick box for single window')'</label>
  703. <default>'${SINGLEFLAG}'</default>
  704. <variable>NEWSINGLEFLAG</variable>
  705. </checkbox>
  706. <hseparator></hseparator>
  707. <text xpad="10" xalign="0" space-expand="true" space-fill="true"><label>'$(gettext 'If this checkbox is ticked, pMount will quit immediately after choosing to mount or unmount a partition. If you would prefer pMount to keep running afterward, then untick this box.')'</label><sensitive>false</sensitive></text>
  708. <checkbox>
  709. <sensitive>false</sensitive>
  710. <label>'$(gettext 'Tick for pMount to quit after mount/unmount')'</label>
  711. <default>'${PMOUNTQUIT}'</default>
  712. <variable>NEWPMOUNTQUIT</variable>
  713. </checkbox>
  714. </frame>
  715. <hbox>
  716. <button>
  717. '"`/usr/lib/gtkdialog/xml_button-icon cancel`"'
  718. <label>'$(gettext 'Cancel')'</label>
  719. </button>
  720. <button>
  721. '"`/usr/lib/gtkdialog/xml_button-icon ok`"'
  722. <label>'$(gettext 'Ok')'</label>
  723. <action>exit:OK</action>
  724. </button>
  725. </hbox>
  726. </vbox>
  727. </window>'
  728. RETPARAMS="`echo "$DLGSETENG" | gtkdialog --stdin`"
  729. eval "$RETPARAMS"
  730. if [ "$EXIT" = "OK" ];then
  731. echo "$NEWSINGLEFLAG" > /root/.pmountsingle
  732. echo "$NEWPMOUNTQUIT" > /root/.pmountquit
  733. fi
  734. exec /usr/sbin/$PMOUNT $TOPACTUAL
  735. fi
  736. ###END###