Skip to content
Snippets Groups Projects
Commit 2bd82cde authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

pridana podminka pro tisk usage pokud uzivatel nezada zadny parametr

parent 3b4170cd
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,8 @@ sub trim
#-------------------------------------------------------------------------------
our ($opt_n, $opt_r, $opt_t, $opt_o, $opt_i, $opt_h);
if ($#ARGV == -1) {usage}
die usage unless getopts("n:r:t:i:ho");
my $hostname = $opt_n;
my $requestor = $opt_r;
......@@ -109,9 +111,7 @@ if ($help) {
# superuser controle
my $UID = $<;
if ($UID != 0) {
die errMsg("You must be root for running this script!")
}
if ($UID != 0) {die errMsg("You must be root for running this script!")}
# check parameters definition
switch () {
......
......@@ -89,6 +89,8 @@ sub trim
#-------------------------------------------------------------------------------
our ($opt_n, $opt_r, $opt_s, $opt_d, $opt_i, $opt_h);
if ($#ARGV == -1) {usage}
die usage unless getopts("n:r:s:d:i:h");
my $hostname = $opt_n;
my $requestor = $opt_r;
......@@ -104,9 +106,7 @@ if ($help) {
# superuser controle
my $UID = $<;
if ($UID != 0) {
die errMsg("You must be root for running this script!")
}
if ($UID != 0) {die errMsg("You must be root for running this script!")}
# check parameters definition
switch () {
......
......@@ -85,6 +85,8 @@ sub trim
#-------------------------------------------------------------------------------
our ($opt_h, $opt_i);
if ($#ARGV == -1) {usage}
die usage unless getopts("i:h");
my $client_id = $opt_i;
my $help = $opt_h;
......@@ -96,9 +98,7 @@ if ($help) {
# superuser controle
my $UID = $<;
if ($UID != 0) {
die errMsg("You must be root for running this script!")
}
if ($UID != 0) {die errMsg("You must be root for running this script!")}
# check parameters definition
if (!defined $client_id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment