📄 penguzzle.install
字号:
#!/bin/shusage(){ echo "USAGE : penguzzle.install [-h] [-b pzlbase] [-w wishxdir]" echo echo -e "\t-h :\tGive a short explanation of the options" echo echo -e "\t-b pzlbase :\tPzlbase will be the base directory where to install Penguzzle." echo -e "\t\t\tA sub-directory penguzzle$ver will be created." echo -e "\t\t\tAll the files will be copied in pzlbase/penguzzle$ver" echo -e "\t\t\tThe Penguzzle program itself will be pzlbase/penguzzle$ver/bin/penguzzle" echo -e "\t\t\tFor example, if you type :" echo -e "\t\t\tpenguzzle.install -b /var" echo -e "\t\t\tthe script will :" echo -e "\t\t\t\t- create /var/penguzzle$ver" echo -e "\t\t\t\t- install Penguzzle in /var/penguzzle$ver" echo -e "\t\t\tpzlbase defaults to /usr/local" echo echo -e "\t-w wishxdir :\tUsed to indicate the absolute path for wishx." echo -e "\t\t\twishxdir defaults to /usr/bin" exit 0}x=$#dir=/usr/bin/wishxpzlbase=/usr/localver=1.0clearechoecho "********************************"echo "Penguzzle Version $ver"echo "by Marie Caroline Pavoine"echo "November 3 2000"echo "********************************"echowhile [ $x -gt 0 ];docase $1 in -h) usage ;; -b) if [ $x -gt 1 ]; then pzlbase=$2 shift shift else usage fi ;; -w) if [ $x -gt 1 ]; then dir=$2 shift shift else usage fi ;; *) usage ;;esacx=$#done if [ ! -e $pzlbase ];then mkdir -p $pzlbasefiif [ ! -w $pzlbase ];then echo "Unable to write into $pzlbase" echo "Try to install Penguzzle in another directory or install it as root" exit 1fiecho Copying components in $pzlbase/penguzzle$ver...if [ ! -x $dir ];then echo "$dir is not a valid wishx program" exit 1ficurrent=`dirname $0`cur=`pwd`mkdir $pzlbase/penguzzle$vercp $current/penguzzle.install $current/README $current/LICENSE $pzlbase/penguzzle$vermkdir $pzlbase/penguzzle$ver/bincp $current/bin/* $pzlbase/penguzzle$ver/binmkdir $pzlbase/penguzzle$ver/images $pzlbase/penguzzle$ver/lib cp $current/images/* $pzlbase/penguzzle$ver/imagescp $current/lib/* $pzlbase/penguzzle$ver/libcd $pzlbase/penguzzle$ver/binawk -v aa=$dir -v bb=$pzlbase/penguzzle$ver/lib 'NR==1{$0="";printf("#!%s",aa);print}NR==3{$0="";printf("source %s/init",bb);print}NR>3{print}' $pzlbase/penguzzle$ver/bin/penguzzle >$pzlbase/penguzzle$ver/bin/penguzzle.tmpmv $pzlbase/penguzzle$ver/bin/penguzzle.tmp $pzlbase/penguzzle$ver/bin/penguzzlechmod 755 $pzlbase/penguzzle$ver/bin/penguzzlecd $pzlbase/penguzzle$ver/libawk -v bb=$pzlbase/penguzzle$ver/images 'NR==1{$0="";printf("set IMGPATH %s",bb);print}NR>1{print}' $pzlbase/penguzzle$ver/lib/init >$pzlbase/penguzzle$ver/lib/init.tmpmv $pzlbase/penguzzle$ver/lib/init.tmp $pzlbase/penguzzle$ver/lib/initcd $curecho "#!/bin/sh" >$pzlbase/penguzzle$ver/penguzzle.uninstallecho "rm -ri $pzlbase/penguzzle$ver" >>$pzlbase/penguzzle$ver/penguzzle.uninstallchmod 755 $pzlbase/penguzzle$ver/penguzzle.uninstallecho "Installation completed"echo "Penguzzle is located at $pzlbase/penguzzle$ver/bin/penguzzle"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -