[X2Go-Commits] [telekinesis] 03/03: server: use dos2unix on bin/tekicmd.

git-admin at x2go.org git-admin at x2go.org
Fri Jan 9 02:16:49 CET 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository telekinesis.

commit ed833bd756feb7a0dab1c0865a00662617fe4014
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Jan 9 02:16:29 2015 +0100

    server: use dos2unix on bin/tekicmd.
---
 server/bin/tekicmd |  214 ++++++++++++++++++++++++++--------------------------
 1 file changed, 107 insertions(+), 107 deletions(-)

diff --git a/server/bin/tekicmd b/server/bin/tekicmd
index 4a4f9db..c8518ee 100644
--- a/server/bin/tekicmd
+++ b/server/bin/tekicmd
@@ -1,107 +1,107 @@
-#!/usr/bin/perl -T -I /home/test2/telekinesis/lib/
-#################################################################################################################
-#
-# Copyright (C) 2013-2015 X2Go Project - http://wiki.x2go.org
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the
-# Free Software Foundation, Inc.,
-# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# Copyright (C) 2013-2015 Guangzhou Nianguan Electronics Technology Co.Ltd. <opensource at gznianguan.com>
-#
-#################################################################################################################
-use strict;
-use X2Go::Telekinesis::CoreSupport qw(   premZealot getConnectToken getCmdFlags dbugPrint tcDie sanitizeDirPath sanitizeFilePath sanitizer checkPID genRandSID genRandToken clups);
-use IO::Socket::UNIX qw( SOCK_STREAM );
-my %CmdFlags = getCmdFlags(@ARGV);
-my $X2GoSID = 0;
-
-if (sanitizer("x2gosid",$CmdFlags{'X2GOSID'})) {
- $X2GoSID = sanitizer("x2gosid",$CmdFlags{'X2GOSID'});
-} elsif (sanitizer("x2gosid",$ENV{'X2GO_SESSION'})) {
-  $X2GoSID = sanitizer("x2gosid",$ENV{'X2GO_SESSION'});
-} else {
-  print "No X2Go Session ID in ENV or ARGV!\n";
-  exit;
-}
-
-my ($uidName,undef) = getpwuid($<);
-my $UserHome    = sanitizeDirPath($ENV{'HOME'});
-unless (-d $UserHome) {tcDie("User got no HOME directory?");}
-my $UserName = sanitizer("pnixusername",$uidName);
-if ($UserName eq 0) {tcDie("Is \"$UserName\" a valid portable UNIX username?\nNah.... Didn't think so....\nWe're done! BYE BYE!\n");}
-my $X2GoSesHome = sanitizeDirPath("$UserHome/.x2go/C-$X2GoSID");
-my $X2GoTKSHome = "$X2GoSesHome/telekinesis";
-my $TeKiLSockPath = "$X2GoSesHome/telekinesis/local/sock";
-
-if (lc(@ARGV[0]) =~ /-shell/) {
-  print "Telekinesis Interactive SHELL:\n(Hint: 'help' prints available commands...)\n";
-  cmdPrompt();
-} else {
-  if ($CmdFlags{'SESSIONSUSPEND'}) {
-#    print "SUSPEND\n";
-    doLocalQuickie("CORE|SUSPEND");
-  } elsif ($CmdFlags{'SESSIONRESUME'}) {
-#    print "RESUME\n";
-    doLocalQuickie("CORE|RESUME");
-  }
-}
-
-
-
-
-
-
-sub cmdPrompt {
-  print "\nTeKi# ";
-  my $cmd = lc(<STDIN>);$cmd =~ s/[\n]//g;
-#  print "	GOT: $cmd\n";
-
-  if ($cmd =~ /help/) {
-    print "In interactive mode the 'tekicmd' tool is most usefull for debugging.\n",
-          "The following commands are available in this interactive shell:\n\n",
-          "	help		Shows this help message.\n",
-          "	quit/exit	Terminates this tool. The Telekinesis instance is unaffected\n";
-  } elsif ($cmd =~ /hello/) {
-    print  "Yes yes yes.... Hello to you too!\n";
-  } elsif ($cmd =~ /fuck/) {
-    print "Seriously!?!?! Profanities?! Like that's going to help....\n";
-  } else {
-    print "'$cmd' does not seem to be a valid command....\nIf it wasnt a simple typo, you'd probably want to check out the 'help' command\nJust saying....\n";
-  }
-  unless (($cmd =~ /exit/) or ($cmd =~ /quit/)) {
-    cmdPrompt();
-  } else {
-    print "\nExiting... bye bye!\n\n";
-    exit;
-  }
-}
-
-sub doLocalQuickie {
-  my $stuffToSay = clups($_[0]);
-  if (-S $TeKiLSockPath) {
-    my $QuickSocket = IO::Socket::UNIX->new(  Peer      => $TeKiLSockPath,
-                                              Type      => SOCK_STREAM,
-                                              Timeout   => 10 );
-    if (defined $QuickSocket) {
-      print $QuickSocket "\nQUICKIE|$stuffToSay|\n";
-      $QuickSocket->close;
-      $QuickSocket = undef;
-    } else {
-      die("ERROR: Can't connect to local socket");
-    }
-  }  else {return 0;}
-}
-
-
+#!/usr/bin/perl -T -I /home/test2/telekinesis/lib/
+#################################################################################################################
+#
+# Copyright (C) 2013-2015 X2Go Project - http://wiki.x2go.org
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Copyright (C) 2013-2015 Guangzhou Nianguan Electronics Technology Co.Ltd. <opensource at gznianguan.com>
+#
+#################################################################################################################
+use strict;
+use X2Go::Telekinesis::CoreSupport qw(   premZealot getConnectToken getCmdFlags dbugPrint tcDie sanitizeDirPath sanitizeFilePath sanitizer checkPID genRandSID genRandToken clups);
+use IO::Socket::UNIX qw( SOCK_STREAM );
+my %CmdFlags = getCmdFlags(@ARGV);
+my $X2GoSID = 0;
+
+if (sanitizer("x2gosid",$CmdFlags{'X2GOSID'})) {
+ $X2GoSID = sanitizer("x2gosid",$CmdFlags{'X2GOSID'});
+} elsif (sanitizer("x2gosid",$ENV{'X2GO_SESSION'})) {
+  $X2GoSID = sanitizer("x2gosid",$ENV{'X2GO_SESSION'});
+} else {
+  print "No X2Go Session ID in ENV or ARGV!\n";
+  exit;
+}
+
+my ($uidName,undef) = getpwuid($<);
+my $UserHome    = sanitizeDirPath($ENV{'HOME'});
+unless (-d $UserHome) {tcDie("User got no HOME directory?");}
+my $UserName = sanitizer("pnixusername",$uidName);
+if ($UserName eq 0) {tcDie("Is \"$UserName\" a valid portable UNIX username?\nNah.... Didn't think so....\nWe're done! BYE BYE!\n");}
+my $X2GoSesHome = sanitizeDirPath("$UserHome/.x2go/C-$X2GoSID");
+my $X2GoTKSHome = "$X2GoSesHome/telekinesis";
+my $TeKiLSockPath = "$X2GoSesHome/telekinesis/local/sock";
+
+if (lc(@ARGV[0]) =~ /-shell/) {
+  print "Telekinesis Interactive SHELL:\n(Hint: 'help' prints available commands...)\n";
+  cmdPrompt();
+} else {
+  if ($CmdFlags{'SESSIONSUSPEND'}) {
+#    print "SUSPEND\n";
+    doLocalQuickie("CORE|SUSPEND");
+  } elsif ($CmdFlags{'SESSIONRESUME'}) {
+#    print "RESUME\n";
+    doLocalQuickie("CORE|RESUME");
+  }
+}
+
+
+
+
+
+
+sub cmdPrompt {
+  print "\nTeKi# ";
+  my $cmd = lc(<STDIN>);$cmd =~ s/[\n]//g;
+#  print "	GOT: $cmd\n";
+
+  if ($cmd =~ /help/) {
+    print "In interactive mode the 'tekicmd' tool is most usefull for debugging.\n",
+          "The following commands are available in this interactive shell:\n\n",
+          "	help		Shows this help message.\n",
+          "	quit/exit	Terminates this tool. The Telekinesis instance is unaffected\n";
+  } elsif ($cmd =~ /hello/) {
+    print  "Yes yes yes.... Hello to you too!\n";
+  } elsif ($cmd =~ /fuck/) {
+    print "Seriously!?!?! Profanities?! Like that's going to help....\n";
+  } else {
+    print "'$cmd' does not seem to be a valid command....\nIf it wasnt a simple typo, you'd probably want to check out the 'help' command\nJust saying....\n";
+  }
+  unless (($cmd =~ /exit/) or ($cmd =~ /quit/)) {
+    cmdPrompt();
+  } else {
+    print "\nExiting... bye bye!\n\n";
+    exit;
+  }
+}
+
+sub doLocalQuickie {
+  my $stuffToSay = clups($_[0]);
+  if (-S $TeKiLSockPath) {
+    my $QuickSocket = IO::Socket::UNIX->new(  Peer      => $TeKiLSockPath,
+                                              Type      => SOCK_STREAM,
+                                              Timeout   => 10 );
+    if (defined $QuickSocket) {
+      print $QuickSocket "\nQUICKIE|$stuffToSay|\n";
+      $QuickSocket->close;
+      $QuickSocket = undef;
+    } else {
+      die("ERROR: Can't connect to local socket");
+    }
+  }  else {return 0;}
+}
+
+

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/telekinesis.git


More information about the x2go-commits mailing list