master
Stephen Cochrane 2 years ago
parent 9eaab17739
commit ca4793dc82
  1. 8
      pman

@ -82,14 +82,12 @@ cron()
add|a)
if ! grep "$job" "$cronfile" > /dev/null
then
echo "$job" >> "$cronfile"
echo "$job" >> "$cronfile" # Add if its not in the file
fi
;;
remove|rem|r)
if grep "$job" "$cronfile" > /dev/null
then
sed -i "s|$job||g" "$cronfile" # warning, $job could become a regex, make this safer
fi
grep -v "$job" "$cronfile" > "$cronfile.tmp" # remove, using invert matching
mv "$cronfile.tmp" "$cronfile" # Rename
;;
esac

Loading…
Cancel
Save