]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Fixing lib/functions.rc
authorFrank Brehm <frank@brehm-online.com>
Tue, 20 Apr 2021 05:29:30 +0000 (07:29 +0200)
committerFrank Brehm <frank@brehm-online.com>
Tue, 20 Apr 2021 05:29:30 +0000 (07:29 +0200)
lib/functions.rc

index 657003e93f893015b70cc9dbd3ff4042f7faa8a7..7b5c27ccdff0680b5714d5c1140c53ee669923cd 100644 (file)
@@ -322,10 +322,15 @@ error() {
 #------------------------------------------------------------------------------
 RM() {
 
+    local cmd="rm $*"
+    if [[ "${VERBOSE}" == "y" ]] ; then
+        cmd="rm --verbose $*"
+    fi
     if [[ "${SIMULATE}" == "y" ]] ; then
-        debug "Simulated removing of: $*"
+        info "Executing: ${cmd}"
         return
     fi
+    debug "Executing: ${cmd}"
     if [[ "${VERBOSE}" != "y" ]] ; then
         rm "$@"
     else
@@ -345,11 +350,26 @@ purge() {
 
 }
 
+#------------------------------------------------------------------------------
+MKDIR() {
+
+    local cmd="mkdir $*"
+    if [[ "${VERBOSE}" == "y" ]] ; then
+        cmd="mkdir --verbose $*"
+    fi
+    if [[ "${SIMULATE}" == "y" ]] ; then
+        info "Executing: ${cmd}"
+        return
+    fi
+    debug "Executing: ${cmd}"
+    eval ${cmd}
+}
+
 #------------------------------------------------------------------------------
 CP() {
 
     local cmd="cp $*"
-    if [[ "${VERBOSE}" != "y" ]] ; then
+    if [[ "${VERBOSE}" == "y" ]] ; then
         cmd="cp --verbose $*"
     fi
     if [[ "${SIMULATE}" == "y" ]] ; then
@@ -369,7 +389,7 @@ CP() {
 MV() {
 
     local cmd="mv $*"
-    if [[ "${VERBOSE}" != "y" ]] ; then
+    if [[ "${VERBOSE}" == "y" ]] ; then
         cmd="mv --verbose $*"
     fi
     if [[ "${SIMULATE}" == "y" ]] ; then
@@ -389,7 +409,7 @@ MV() {
 CHOWN() {
 
     local cmd="chown $*"
-    if [[ "${VERBOSE}" != "y" ]] ; then
+    if [[ "${VERBOSE}" == "y" ]] ; then
         cmd="chown --verbose $*"
     fi
     if [[ "${SIMULATE}" == "y" ]] ; then
@@ -409,7 +429,7 @@ CHOWN() {
 CHMOD() {
 
     local cmd="chmod $*"
-    if [[ "${VERBOSE}" != "y" ]] ; then
+    if [[ "${VERBOSE}" == "y" ]] ; then
         cmd="chmod --verbose $*"
     fi
     if [[ "${SIMULATE}" == "y" ]] ; then
@@ -429,7 +449,7 @@ CHMOD() {
 LN() {
 
     local cmd="ln $*"
-    if [[ "${VERBOSE}" != "y" ]] ; then
+    if [[ "${VERBOSE}" == "y" ]] ; then
         cmd="ln --verbose $*"
     fi
     if [[ "${SIMULATE}" == "y" ]] ; then