own3mall 6 лет назад
Родитель
Сommit
2aa0d825b3
2 измененных файлов с 17 добавлено и 0 удалено
  1. 9 0
      OGP/ogp_agent.pl
  2. 8 0
      OGP/ogp_screenrc_bk

+ 9 - 0
OGP/ogp_agent.pl

@@ -76,6 +76,8 @@ use constant GAME_STARTUP_DIR =>
   Path::Class::Dir->new(AGENT_RUN_DIR, 'startups');
 use constant SCREENRC_FILE =>
   Path::Class::File->new(AGENT_RUN_DIR, 'ogp_screenrc');
+use constant SCREENRC_FILE_BK =>
+  Path::Class::File->new(AGENT_RUN_DIR, 'ogp_screenrc_bk');
 use constant SCREEN_TYPE_HOME   => "HOME";
 use constant SCREEN_TYPE_UPDATE => "UPDATE";
 use constant FD_DIR => Path::Class::Dir->new(AGENT_RUN_DIR, 'FastDownload');
@@ -137,6 +139,13 @@ sub logger
 	close(LOGFILE) or die("Failed to close log file.");
 }
 
+# If for some reason the screenrc file doesn't exist, restore it from the backup copy
+# I've seen this happen a few times
+if (! -e SCREENRC_FILE)
+{
+	copy(SCREENRC_FILE_BK,SCREENRC_FILE);
+}
+
 # Check the screen logs folder
 if (!-d SCREEN_LOGS_DIR && !mkdir SCREEN_LOGS_DIR)
 {

+ 8 - 0
OGP/ogp_screenrc_bk

@@ -0,0 +1,8 @@
+startup_message off
+hardstatus on
+hardstatus alwayslastline '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}[%{W}%n%f %t%?(%u)%?%{=b kR}]%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %D %m/%d %C%a ]%{W}'
+# Default scroll back 100
+defscrollback 100
+deflog on
+logfile /OGP/screenlogs/screenlog.%t
+