Code Sample |
#!/bin/bash #targz2uci.sh if [ -z $1 ] then echo no file name to convert! echo "usage: targz2uci.sh mypackage.tar.gz" else PACKAGENAME=`echo $1 | sed 's/\.tar\.gz$//'` mkdir work sudo tar -xzvf $1 --same-owner -C work tar -tzf $1 | grep -v "^opt" | tee work/user.files cd work sudo tar -czvf opt/$PACKAGENAME/user.tar.gz --numeric-owner --no-recursion -T user.files cd opt mkisofs -R -hide-rr-moved -cache-inodes -pad $PACKAGENAME/ | \ create_compressed_fs - 65536 > ../../$PACKAGENAME.uci fi |
Code Sample |
table Icon Type: Program Caption: My Program Command: /opt/mypackage/bin/myprogram Icon: .xtdesktop/mypackage.png MenuCommand1: my menu text:/opt/bin/program2 X: 400 Y: 400 Status: anchor end |
Code Sample |
#!/bin/bash #targz2uci.sh if [ -z $1 ] || ( echo $1 | grep -qv "tar.gz$" ) then echo "usage: targz2uci.sh mypackage.tar.gz" exit -1 else PACKAGENAME=`echo $1 | sed 's/\.tar\.gz$//'` mkdir work sudo tar -xzvf $1 --same-owner -C work tar -tzf $1 | grep -v "^opt" > work/user.files # Check extension basename against the name in the opt directory if ! [ -d work/opt/$PACKAGENAME ] then echo "uci files must have their base name and the name" echo "of the directory they create in /opt the same" exit -1 else echo "base name check OK" fi # Check that their are only tmp, var, etc, and home directories besides the opt if ( grep -v "^home" work/user.files | grep -qv "^etc" | grep -qv "^tmp" | grep -qv "^var" ) then echo "Directories other than home, etc, tmp, and var found in archive." echo "only opt, home, etc, tmp, and var directories are allowed in uci files!" exit -1 else echo "check for home, etc, tmp, \& var OK" fi # Check the menu file's name against the basename if [ -d work/tmp/mydsl.menu ] && ( ls work/tmp/mydsl.menu/ | grep -qv "^$PACKAGENAME$" ) then echo "menu name not the same as the extension" exit -1 else echo "menu file name OK" fi # Check the icon file names against the basename if [ -d work/home/dsl/.xtdesktop ] && ( ls work/home/dsl/.xtdesktop/ | grep -qv "^$PACKAGENAME\." ) then echo "icon items do not match extension name" exit -1 else echo "icon file name OK" fi cd work sudo tar -czvf opt/$PACKAGENAME/user.tar.gz --numeric-owner --no-recursion -T user.files cd opt mkisofs -R -hide-rr-moved -cache-inodes -pad $PACKAGENAME/ | \ create_compressed_fs - 65536 > ../../$PACKAGENAME.uci fi |
Code Sample |
echo "uci files must have their base name and the name" echo "of the directory they create in /opt the same" |
Code Sample |
echo "uci files must have their base name and the name of the directory they create in /opt the same" |