diff options
author | Dirk | 2014-02-21 11:16:02 +0100 |
---|---|---|
committer | Dirk | 2014-02-21 11:16:02 +0100 |
commit | 1e30627c5b00884054fae7210d036e34ebe4f181 (patch) | |
tree | 6d258c5a7a2279881706f38e37921dc4557a0b8d /remote/modules/vmchooser | |
parent | Setzen des Windows-Namens beim Booten aus Laufwerk B: (diff) | |
parent | [nvidia_libs] Debug: Checkin für Joey:). (diff) | |
download | tm-scripts-1e30627c5b00884054fae7210d036e34ebe4f181.tar.gz tm-scripts-1e30627c5b00884054fae7210d036e34ebe4f181.tar.xz tm-scripts-1e30627c5b00884054fae7210d036e34ebe4f181.zip |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
...
Diffstat (limited to 'remote/modules/vmchooser')
-rwxr-xr-x | remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt index f9ee1ae6..2cd92776 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt @@ -434,17 +434,28 @@ amixer -q sset Front "$VOL" unmute 2>/dev/null amixer -q sset Speaker "$VOL" unmute 2>/dev/null # annoying built-in speaker amixer -q sset 'Front Mic' "$VOL" unmute 2>/dev/null # to be checked if Mic is actually activated amixer -q sset 'Rear Mic' "$VOL" unmute 2>/dev/null # =""= +amixer -q -c pcsp sset Master "0%" mute 2>/dev/null # fix random static noise when starting vmplayer TODO: find out why?! -# Start printer daemon +# Start printer daemon +QUEUE="STANDARD" # This has to match the queue you configured in your VM USER="$(whoami)" -SPOOLDIR="/var/spool" -QUEUE="STANDARD" +# Try using users tmpfs home first, as it gets wiped on logout +if [ -n "${HOME}" ] && [ -w "${HOME}" ]; then + SPOOLDIR="${HOME}/.spool" + mkdir -p "${SPOOLDIR}/${QUEUE}" +fi +# If failed, try to fall back to /tmp +if [ -z "${SPOOLDIR}" ] || [ ! -w "${SPOOLDIR}/${QUEUE}" ]; then + SPOOLDIR="/tmp/printergui/${USER}/" + rm -rf -- "${SPOOLDIR}" + mkdir -p "${SPOOLDIR}/${QUEUE}" +fi # Start the lpdaemon listening on the given port -# FixMe: Solution for general printer redirection in other cases (iptables on outgoing port) +# TODO: externalize with something like runtvirt.d (other parts might benefit from that too) tcpsvd -E 192.168.101.1 5515 \ lpd "$SPOOLDIR" \ - sh -c "printergui $USER $SPOOLDIR/$QUEUE/\$DATAFILE" & + ash -c "/opt/openslx/cups/printergui '${USER}' \"${SPOOLDIR}/${QUEUE}/\$DATAFILE\"" & # PID to kill the process PID_LPD="$!" |