[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non-interactive use of ezjail-admin update -P

Hello to all,

If you have ever tried to run ezjail-admin update -P non-interactively,
for example from cron or like in

$ ssh mymachine ezjail-admin update -P

you will have received an error from portsnap which points out that
portsnap should not be run non-interactively. Now if i am not mistaken I
have read that this had been fixed quite some time ago however i could
not find the fix and it is obviously not in the freebsd ports tree. The
following patch i attach solves this little problem

--- ezjail-2.0.1/ezjail-admin   Mon Jul 24 14:07:58 2006
+++ ezjail-2.0.1-new/ezjail-admin       Mon Jun  4 13:12:56 2007
@@ -145,7 +145,11 @@
     echo "Gathering local information may take a while."
     cd ${ezjail_jailbase}/usr/ports/ && cvs -d ${ezjail_portscvsroot}
up -Pd
-    portsnap fetch
+    if ! [ -t 0 ]; then
+      portsnap cron
+    else
+      portsnap fetch
+    fi
     [ -d ${ezjail_jailbase}/usr/ports ] && ezjail_portsnapaction=update
     portsnap -p ${ezjail_jailbase}/usr/ports

Keep up the good work guys.

Alexandros Kosiaris 	Network Management Center , NTUA
e-mail : alex AT noc.ntua DOT gr
Public Key Fingerprint :
D6B1 0634 BE65 719C 6C95  7492 8201 4B46 C478 F074

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature