diff options
Diffstat (limited to 'scripts/openbsd_firefox')
| -rwxr-xr-x | scripts/openbsd_firefox | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/openbsd_firefox b/scripts/openbsd_firefox new file mode 100755 index 0000000..a34abcb --- /dev/null +++ b/scripts/openbsd_firefox | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | DATASIZE="10485760" | ||
| 4 | OPENFILES="400" | ||
| 5 | |||
| 6 | xm_log() { | ||
| 7 | echo -n "$@\nDo you want to run Firefox anyway?\n\ | ||
| 8 | (If you don't increase these limits, Firefox might fail to work properly.)" | \ | ||
| 9 | xmessage -file - -center -buttons yes:0,no:1 -default no | ||
| 10 | } | ||
| 11 | |||
| 12 | |||
| 13 | # A stack overflow post said you also have to increase virtmem but that | ||
| 14 | # doesn't seem to be the case. If tabs start crashing then try increasing | ||
| 15 | # virtmem. | ||
| 16 | |||
| 17 | #if [ $(ulimit -Sv) -lt ${DATASIZE} ]; then | ||
| 18 | # ulimit -Sv ${DATASIZE} || \ | ||
| 19 | # xm_log "Cannot increase virtualmem-cur to at least ${DATASIZE}" | ||
| 20 | # [ $? -eq 0 ] || exit | ||
| 21 | #fi | ||
| 22 | |||
| 23 | if [ $(ulimit -Sd) -lt ${DATASIZE} ]; then | ||
| 24 | ulimit -Sd ${DATASIZE} || \ | ||
| 25 | xm_log "Cannot increase datasize-cur to at least ${DATASIZE}" | ||
| 26 | [ $? -eq 0 ] || exit | ||
| 27 | fi | ||
| 28 | |||
| 29 | if [ $(ulimit -Sn) -lt ${OPENFILES} ]; then | ||
| 30 | ulimit -Sn ${OPENFILES} || \ | ||
| 31 | xm_log "Cannot increase openfiles-cur to at least ${OPENFILES}" | ||
| 32 | [ $? -eq 0 ] || exit | ||
| 33 | fi | ||
| 34 | |||
| 35 | exec /usr/local/bin/firefox "${@}" | ||