Code Sample |
#!/bin/sh # # .start_siag - Checks to see if SIAG Office is already installed # and starts run menu. Else, run the install script first. # Rev 0 11/30/03 # # Menu code stolen from xsetup.sh originally written by: # (c) 2003 Granig Andreas <andreas.granig@gmx.net> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # ############################################################## # Check to see if SIAG is already installed if test -f '/usr/local/bin/siag' then echo 'Siag already installed, loading menu...' else # Otherwise, run the insall script as root cd /home/damnsmall rxvt -rv -T "installing SIAG Office..." -e sudo -u root ./.install_siag fi #Siag Office Run Menu starts here OFFICEAPP="egon gvu siag pw xedplus xfiler" # Default Parameters DEF_OFFICEAPP="egon" # Path to dialog application DIALOG=/usr/bin/dialog MENUHEAD="Siag Office Run Menu:\n" MENUTOP=" egon = presentation and animation program\n gvu = Postscript viewer program\n siag = Scheme In A Grid spreadsheet program\n pw = Pathetic Writer word processing program\n xedplus = text editor program\n xfiler = file manager program\n" # Row and Columns for menu COLS=68 ROWS=6 # Save tempfile creation TMPFILE=`tempfile -d /tmp -p lingu 2>/dev/null` ############################################################## # Sub definitions ############################################################## OnCancel() { OnDefault "You have canceled the Siag Office routine." } OnError() { OnDefault "An unknown error occured during the Siag Office routine." } OnDefault() { exit 1; } CheckReturnVal() { case $? in 0);; 1) OnCancel;; *) OnError;; esac } ShowMenu() { ITEMS="" for i in $3; do ITEMS="$ITEMS $i $2"; done; $DIALOG --menu \ "$1" 20 $COLS $ROWS $ITEMS 2>$TMPFILE CheckReturnVal } ############################################################## # Let's launch the menu... ############################################################## # Choose your office application ShowMenu "$MENUHEAD\n$MENUTOP\nChoose the application to run:" "Application" "$OFFICEAPP" SELAPP=`cat $TMPFILE`; rm -f $TMPFILE exec /usr/local/bin/$SELAPP & exit |
Code Sample |
#!/bin/sh # # .install_siag - Downloads and installs SIAG Office for a # Damn Small Linux user. # Rev 0 11/29/03 # # First, create a /usr tree on the ramdisk if the user is running from # the Damn Small Linux Live CD. Why? Because the default /usr tree is # linked to the read-only CDROM file system and new files are not allowed. # Lets create a REAL /usr tree structure on the ramdisk and add a bunch of # Symlinks back to the CDROM for all of the files inside the old /usr tree. ls -l /usr | grep 'KNOPPIX' > /tmp/installsiag.tmp if test -s '/tmp/installsiag.tmp' then echo 'System is running from a Live CD compressed image filesystem. ' echo 'Creating a writable /usr tree on the RAM Disk...' cp -srd /KNOPPIX/usr/ /ramdisk ln -sf --target-directory=/ /ramdisk/usr fi rm /tmp/installsiag.tmp # Next, download, unpack and install the Vector Linux 3.2 Mowitz libraries echo 'Grabbing Mowitz libraries...' wget -c http://www.ibiblio.org/pub/linux/distributions/vectorlinux/veclinux-3.2/packages/Mowitz-0.2.2-i386-1.tgz tar -zxvf Mowitz-0.2.2-i386-1.tgz rm -rf /home/damnsmall/Mowitz-0.2.2-i386-1.tgz sh ./install/doinst.sh # Next, download, unpack and install the Vector Linux 3.2 XawM libraries echo 'Grabbing XawM libraries...' wget -c http://www.ibiblio.org/pub/linux/distributions/vectorlinux/veclinux-3.2/packages/XawM-1.5u-i386-1.tgz tar -zxvf XawM-1.5u-i386-1.tgz rm -rf /home/damnsmall/XawM-1.5u-i386-1.tgz sh ./install/doinst.sh # Next, download, unpack and install the Vector Linux 3.2 SIAG Office binaries echo 'Grabbing SIAG Office binaries...' wget -c http://www.ibiblio.org/pub/linux/distributions/vectorlinux/veclinux-3.2/packages/siag-3.5.7-i386-1.tgz tar -zxvf siag-3.5.7-i386-1.tgz rm -rf /home/damnsmall/siag-3.5.7-i386-1.tgz sh ./install/doinst.sh # Before finishing the install, move the newly installed files into # the main /usr tree. cd /usr cp -r --reply=yes /home/damnsmall/usr ../ cd /home/damnsmall # Creating symbolic links to the new libraries cd /usr/lib ln -s /usr/local/lib/libXawM.so.1.0.0 libXawM.so.1 ln -s /usr/local/lib/libMowitz.so.0.2.2 libMowitz.so.0 cd /home/damnsmall # Create Desktop Icon for SIAG Office programs cp /usr/local/share/siag/common/bitmaps/egon.xpm /home/damnsmall/.xtdesktop/egon.xpm echo 'table Icon' > /home/damnsmall/.xtdesktop/egon.lnk echo ' Type: Program' >> /home/damnsmall/.xtdesktop/egon.lnk echo ' Caption: Egon' >> /home/damnsmall/.xtdesktop/egon.lnk echo ' Command: egon' >> /home/damnsmall/.xtdesktop/egon.lnk echo ' Icon: /home/damnsmall/.xtdesktop/egon.xpm' >> /home/damnsmall/.xtdesktop/egon.lnk echo ' X: 295' >> /home/damnsmall/.xtdesktop/egon.lnk echo ' Y: 200' >> /home/damnsmall/.xtdesktop/egon.lnk echo 'end' >> /home/damnsmall/.xtdesktop/egon.lnk chown damnsmall:staff /home/damnsmall/.xtdesktop/egon.lnk chown damnsmall:staff /home/damnsmall/.xtdesktop/egon.xpm # Create Desktop Icon for SIAG Office programs cp /usr/local/share/siag/common/bitmaps/pw.xpm /home/damnsmall/.xtdesktop/pw.xpm echo 'table Icon' > /home/damnsmall/.xtdesktop/pw.lnk echo ' Type: Program' >> /home/damnsmall/.xtdesktop/pw.lnk echo ' Caption: Pathetic Writer' >> /home/damnsmall/.xtdesktop/pw.lnk echo ' Command: pw' >> /home/damnsmall/.xtdesktop/pw.lnk echo ' Icon: /home/damnsmall/.xtdesktop/pw.xpm' >> /home/damnsmall/.xtdesktop/pw.lnk echo ' X: 295' >> /home/damnsmall/.xtdesktop/pw.lnk echo ' Y: 286' >> /home/damnsmall/.xtdesktop/pw.lnk echo 'end' >> /home/damnsmall/.xtdesktop/pw.lnk chown damnsmall:staff /home/damnsmall/.xtdesktop/pw.lnk chown damnsmall:staff /home/damnsmall/.xtdesktop/pw.xpm # Create Desktop Icon for SIAG Office programs cp /usr/local/share/siag/common/bitmaps/siag.xpm /home/damnsmall/.xtdesktop/siag.xpm echo 'table Icon' > /home/damnsmall/.xtdesktop/siag.lnk echo ' Type: Program' >> /home/damnsmall/.xtdesktop/siag.lnk echo ' Caption: Siag' >> /home/damnsmall/.xtdesktop/siag.lnk echo ' Command: siag' >> /home/damnsmall/.xtdesktop/siag.lnk echo ' Icon: /home/damnsmall/.xtdesktop/siag.xpm' >> /home/damnsmall/.xtdesktop/siag.lnk echo ' X: 295' >> /home/damnsmall/.xtdesktop/siag.lnk echo ' Y: 359' >> /home/damnsmall/.xtdesktop/siag.lnk echo 'end' >> /home/damnsmall/.xtdesktop/siag.lnk chown damnsmall:staff /home/damnsmall/.xtdesktop/siag.lnk chown damnsmall:staff /home/damnsmall/.xtdesktop/siag.xpm # Clean up some junk in the /home/damnsmall directory rm -rf /home/damnsmall/usr rm -rf /home/damnsmall/install rm -rf /home/damnsmall/opt |