diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-23 08:58:32 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-23 08:58:32 +0800 |
commit | 2fb9c23b681dc58ec8132ec01e2ac09ce5dd55c3 (patch) | |
tree | c4362b5f34098bed45c1be5d53aba01391c5eef4 /util/initbbs.c | |
parent | d6ed560ea08f21830f285f13ffc3b28a78b2fcfe (diff) | |
download | pttbbs-2fb9c23b681dc58ec8132ec01e2ac09ce5dd55c3.tar pttbbs-2fb9c23b681dc58ec8132ec01e2ac09ce5dd55c3.tar.gz pttbbs-2fb9c23b681dc58ec8132ec01e2ac09ce5dd55c3.tar.bz2 pttbbs-2fb9c23b681dc58ec8132ec01e2ac09ce5dd55c3.tar.lz pttbbs-2fb9c23b681dc58ec8132ec01e2ac09ce5dd55c3.tar.xz pttbbs-2fb9c23b681dc58ec8132ec01e2ac09ce5dd55c3.tar.zst pttbbs-2fb9c23b681dc58ec8132ec01e2ac09ce5dd55c3.zip |
add dir 'run'
add warning if not first time
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@888 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/initbbs.c')
-rw-r--r-- | util/initbbs.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/util/initbbs.c b/util/initbbs.c index 8d95534c..72988353 100644 --- a/util/initbbs.c +++ b/util/initbbs.c @@ -1,4 +1,4 @@ -/* $Id: initbbs.c,v 1.5 2002/10/26 18:30:44 in2 Exp $ */ +/* $Id: initbbs.c,v 1.6 2003/05/23 00:58:32 in2 Exp $ */ #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -18,6 +18,7 @@ static void initDir() { mkdir("man/boards", 0755); mkdir("out", 0755); mkdir("tmp", 0755); + mkdir("run", 0755); } static void initHome() { @@ -233,7 +234,16 @@ static void initHistory() { } } -int main() { +int main(int argc, char **argv) +{ + if( argc != 2 || strcmp(argv[1], "-DoIt") != 0 ){ + fprintf(stderr, + "警告! initbbs只用在「第一次安裝」的時候.\n" + "若您的站台已經上線, initbbs將會破壞掉原有資料!\n\n" + "確定要執行, 請使用 initbbs -DoIt\n"); + return 1; + } + if(chdir(BBSHOME)) { perror(BBSHOME); exit(1); |