root/1.8.3/trunk/utils/ln-dir.sh
| Revision 846, 5.0 kB (checked in by penndev, 1 year ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | #!/bin/sh |
| 2 | # Program: ln-dir.sh |
| 3 | # Author: David Cheatham / david@mush.cx / Vadiv@M*U*S*H / Vadiv@ChaoticMUX |
| 4 | # Description: Creates symlink game dirs of pennmush |
| 5 | # Date: May 4, 2002 |
| 6 | # |
| 7 | # This script has no warranty. Don't do stupid things like run it on |
| 8 | # an already existing mush. It tried to check for that, but no |
| 9 | # promises. Under no circumstances I can think of will it overwrite |
| 10 | # your db, but it will overwrite your custom text files. |
| 11 | # |
| 12 | # This script is public domain. |
| 13 | # If you haven't messed with it, and something goes wrong, email me. |
| 14 | # |
| 15 | # DIRECTIONS: |
| 16 | # |
| 17 | # TO USE: Find a directory, and run this script in it. It will |
| 18 | # create a game/ in that directory that has everything you need to |
| 19 | # run pennmush. Feel free to rename or move this directory. |
| 20 | # (No, not while you're running it.) |
| 21 | # |
| 22 | # If you have a database and/or help files, etc, copy those in, like you |
| 23 | # would normally. See the FAQ for more info. Note that the included |
| 24 | # help files are symlinked, and it's best if you just leave those and |
| 25 | # create *other* files in that directory, so upgrading is seamless. |
| 26 | # nws/ and evt/ have normal text files in them, as those always change |
| 27 | # per-mush. |
| 28 | # |
| 29 | # |
| 30 | # TO SETUP: Compile pennmush, all the way. You should be able to type |
| 31 | # ./restart and have it launch. In fact, you should do that, it won't |
| 32 | # confuse anything and will save you from problems down the road, if you |
| 33 | # know it works. Then type 'make globalinstall'. All the files that you |
| 34 | # need are put in /usr/libexec/pennmush, but you can move them if you |
| 35 | # want to. (Do it before you create any user installs, though.) |
| 36 | # You can then delete the compile directory. |
| 37 | # |
| 38 | # Note if you're compiling for other users you probably want all the flags |
| 39 | # and options and everything turned on. Otherwise one set of people will be |
| 40 | # whining about warnings and one set about ROY, etc... |
| 41 | # |
| 42 | # That's technically all you need to do. *However*, if you want users to |
| 43 | # not have to type the full path out, you can create a symlink to this |
| 44 | # script, and stick it in your path, with some nice name, and tell |
| 45 | # users about it. I recommend calling it penn-install and sticking it |
| 46 | # in /usr/bin. (I could do it for you, but I want the binaries to be |
| 47 | # freely relocatable, and thus don't want to hardcode a location.) |
| 48 | # |
| 49 | # |
| 50 | # TO UPGRADE: Just do the same thing as an install. All the user |
| 51 | # installs *should* continue to operate, or there should be a |
| 52 | # big warning in the Changelog. If there's something that needs doing, |
| 53 | # hopefully it will be clearly documented. |
| 54 | # |
| 55 | # Then all the user installs just need @shutdown/reboot. Though a |
| 56 | # 'make' in their txt/ directory before that can't hurt. |
| 57 | # |
| 58 | # |
| 59 | # Don't mess with the rest of this file. |
| 60 | |
| 61 | STARTPWD=`pwd`/pennmush |
| 62 | DOWN='' |
| 63 | # Good grief. Why can't we have a command to find the absolute place |
| 64 | # a symlink is pointing at? |
| 65 | cd /`ls -l $0 |cut -d '>' -f 2- | sed 's/\/[^\/]*$//'|cut -d '/' -f 2-` |
| 66 | MASTER=`pwd` |
| 67 | mkdir $STARTPWD |
| 68 | cd $STARTPWD |
| 69 | |
| 70 | mklns() { |
| 71 | while [ $1 ]; do |
| 72 | ln -s $MASTER/$DOWN/$1 |
| 73 | shift |
| 74 | done |
| 75 | } |
| 76 | |
| 77 | mkcps() { |
| 78 | while [ $1 ]; do |
| 79 | cp $MASTER/$DOWN/$1 . |
| 80 | shift |
| 81 | done |
| 82 | } |
| 83 | |
| 84 | mdcd() { |
| 85 | cd $STARTPWD |
| 86 | mkdir -p $1 |
| 87 | cd $1 |
| 88 | DOWN=$1 |
| 89 | } |
| 90 | |
| 91 | if test -f ./ln-dir.sh; then |
| 92 | |
| 93 | echo "Are you running this from the master pennmush directory?" |
| 94 | echo "What exactly is going on here?" |
| 95 | echo "Open this file up and read the instructions." |
| 96 | echo "This creates a pennmush child directory in the currect" |
| 97 | echo "directory. You need to run it in a different directory." |
| 98 | exit |
| 99 | |
| 100 | fi |
| 101 | |
| 102 | if test -f ./utils/ln-dir.sh; then |
| 103 | |
| 104 | echo "If you want to use this script, you need to 'make globalinstall" |
| 105 | echo "as root first, and then run this script from where it's" |
| 106 | echo "installed." |
| 107 | exit |
| 108 | |
| 109 | fi |
| 110 | |
| 111 | if test -f ./game/restart; then |
| 112 | |
| 113 | echo "Okay, I'm confused. You only should run this once, to create" |
| 114 | echo "the directories and symlinks. You shouldn't ever need to run it" |
| 115 | echo "again. And, as I can't figure out which files you've modified," |
| 116 | echo "or what's wrong, that's a bad idea anyway." |
| 117 | echo "If you've run into problems, you should create a new directory." |
| 118 | echo "run me in that, and copy all the files you\'ve modified over." |
| 119 | exit |
| 120 | |
| 121 | fi |
| 122 | |
| 123 | mklns README mushcnf.dst access.README getdate.README getdate.template config.sh |
| 124 | mkcps *.cnf restart |
| 125 | |
| 126 | # Weird binary linking stuff |
| 127 | ln -s $MASTER/netmush |
| 128 | ln -s $MASTER/info_slave |
| 129 | |
| 130 | # I'm a little baffled by needing to do this, but whatever. |
| 131 | chmod u+x restart |
| 132 | |
| 133 | # The mostly empty directorys... |
| 134 | mdcd save |
| 135 | mklns README |
| 136 | |
| 137 | mdcd log |
| 138 | mklns README |
| 139 | |
| 140 | mdcd data |
| 141 | mklns minimal.db |
| 142 | |
| 143 | |
| 144 | # Txt files stuff. |
| 145 | # (Yes, I know compose.sh.SH generates compose.sh, but that never changes.) |
| 146 | mdcd txt |
| 147 | mklns compose.sh.SH compose.sh index-files.pl |
| 148 | |
| 149 | # Copy outright all the text files. Half of these need modifying and the |
| 150 | # other half are autogenerated anyway. |
| 151 | mkcps *.txt Makefile |
| 152 | |
| 153 | # Events and news are mush specific always, and they start out empty anyway |
| 154 | |
| 155 | mdcd txt/evt |
| 156 | mkcps * |
| 157 | mdcd txt/nws |
| 158 | mkcps * |
| 159 | |
| 160 | mdcd txt/hlp |
| 161 | mklns penncode.hlp pennfunc.hlp penntop.hlp pennchat.hlp pennconf.hlp \ |
| 162 | pennmail.hlp pennvers.hlp penncmd.hlp pennflag.hlp pennpueb.hlp |
Note: See TracBrowser for help on using the browser.
