Permalink
Browse files

Merge branch 'master' of github.com:pcbsd/pcbsd

  • Loading branch information...
2 parents e46485b + 4e5cced commit e6acb249c983d3016e71afc96471930e5a4fb842 Ken Moore committed Aug 5, 2013
@@ -72,4 +72,5 @@ fi
# If we are running an intel chipset, load the newer KMS driver automatically
if [ "$loadIntelKMS" = "yes" ] ; then
kldload i915kms
+ touch /tmp/loadIntelKMS
fi
@@ -13,8 +13,9 @@ PROGDIR="/usr/local/share/lpreserver"
DBDIR="/var/db/lpreserver"
if [ ! -d "$DBDIR" ] ; then mkdir -p ${DBDIR} ; fi
CMDLOG="${DBDIR}/lp-lastcmdout"
+REPCONF="${DBDIR}/replication"
LOGDIR="/var/log"
-export DBDIR LOGDIR PROGDIR CMDLOG
+export DBDIR LOGDIR PROGDIR CMDLOG REPCONF
MSGQUEUE=""
export MSGQUEUE
@@ -149,3 +150,40 @@ queue_msg() {
echo_queue_msg() {
echo -e "$MSGQUEUE"
}
+
+add_rep_task() {
+ # add freenas.8343 backupuser 22 tank1/usr/home/kris tankbackup/backups sync
+ HOST=$1
+ USER=$2
+ PORT=$3
+ LDATA=$4
+ RDATA=$5
+ TIME=$6
+
+ case $TIME in
+ [0-9][0-9]|sync) ;;
+ *) exit_err "Invalid time: $TIME"
+ esac
+
+ echo "Adding replication task for local dataset $LDATA"
+ echo "----------------------------------------------------------"
+ echo " Remote Host: $HOST"
+ echo " Remote User: $USER"
+ echo " Remote Port: $PORT"
+ echo "Remote Dataset: $RDATA"
+ echo " Time: $TIME"
+ echo "----------------------------------------------------------"
+ echo "Don't forget to ensure that this user / dataset exists on the remote host"
+ echo "with the correct permissions!"
+
+ rem_rep_task "$LDATA"
+ echo "$LDATA:$TIME:$HOST:$USER:$PORT:$RDATA" >> ${REPCONF}
+
+}
+
+rem_rep_task() {
+ if [ ! -e "$REPCONF" ] ; then return ; fi
+ cat ${REPCONF} | grep -v "^${1}:" > ${REPCONF}.tmp
+ mv ${REPCONF}.tmp ${REPCONF}
+}
+
@@ -88,9 +88,9 @@ Add Options:
Remove Options:
- remove <id>
+ remove <dataset>
- Remove a replication task indicated by <id>
+ Remove a replication task indicated by <dataset>
Use 'replicate list' for a list of IDs.
Usage:
@@ -370,7 +370,22 @@ revertsnap) require_root
SNAP="$3"
${PROGDIR}/backend/zfsrmsnap.sh "${DATASET}" "${SNAP}"
;;
-
+ replicate) require_root
+ shift
+ case ${1} in
+ add) add_rep_task "$2" "$3" "$4" "$5" "$6" "$7" ;;
+ list) ;;
+ remove) cat ${REPCONF} | grep -q "^${2}:"
+ if [ $? -eq 0 ] ; then
+ rem_rep_task "$2"
+ echo "Removed replication task for $2"
+ else
+ exit_err "No such replication task for dataset $2"
+ fi
+ ;;
+ *) exit_err "Invalid option!" ;;
+ esac
+ ;;
*) help_main ;;
esac
@@ -53,12 +53,15 @@ if [ "$1" = "desktop" ] ;then
pbreg set /PC-BSD/SysType PCBSD
touch /etc/defaults/pcbsd
- # Enable showing the PC-BSD 4th screen
- echo "pcbsd_boot=\"YES\"" >> /boot/loader.conf
-
# Init the desktop
/usr/local/bin/pc-extractoverlay desktop --sysinit
+ # Check if we need to load i915kms
+ kldstat | grep -q "i915kms"
+ if [ $? -eq 0 ] ; then
+ echo "i915kms_load=\"YES\"" >> /boot/loader.conf
+ fi
+
# Need to save a language?
if [ -n "$2" ] ; then
echo "$2" > /etc/pcbsd-lang

0 comments on commit e6acb24

Please sign in to comment.