Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. #
  4.  
  5. LocalDir=/var/mail
  6. TempDir=/tmp/mail/backup-`date +%d-%m`
  7. Archive=mail-`date +%d-%m`.bak.tgz
  8. Ruser=sshuser
  9. Rpass=1024
  10. Rcommand=/
  11. Rserver=127.0.0.1
  12.  
  13.  
  14. ssh -c $Rserver <<EOF
  15. $Ruser
  16. $Rpass
  17. $Rcommand
  18. EOF
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. #!/bin/bash
  30. #
  31. #A script which runs as a posthook for tea4cups.
  32. #It calculates the number of pages of a printing job from a user
  33. #and creates a log.
  34. #See declarations for which parameters should be given from the tea4cups posthook.
  35. #
  36. #Author: Christian Ã….
  37. #20100225
  38.  
  39.  
  40. #DECLARATIONS
  41. #These are given by the posthook_billing in /etc/cups/tea4cups.conf
  42. declare IP="$1"
  43. declare JOBID="$2"
  44. declare PRINTER="$3"
  45. declare PAGES=`pkpgcounter $4`
  46. declare USER="$5"
  47. declare MAC=`ssh orestad@tank ./macfinder.sh $1`
  48. declare DATE=`date | sed 's/ /-/g'`
  49. declare PLIST="/billing/prints"
  50.  
  51. #If log is removed or rotated a new one will be created here
  52. #First line will be todays date.
  53. if [ ! -f $PLIST ]; then
  54. echo `date` > $PLIST
  55. chmod 644 $PLIST
  56. fi
  57.  
  58. #Logs the current printing job
  59. echo "$IP::$MAC::$USER::$PAGES::$JOBID::$PRINTER::$DATE" >> /billing/prints
  60.  
  61. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement