-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport_local__remove_my_tail
executable file
·41 lines (35 loc) · 1.22 KB
/
export_local__remove_my_tail
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# ~/export_local
# Variables and functions which are specific to the local machine go here.
# File should be sourced from ~/export_envs which should be sourced in .bashrc
# Examples:
function cdd {
cd "/somewhere/commonly/visited/$1"
}
export TASK_TAG_KEY_CHECKER_KEY_PATH="path_to_task_tagkey"
if [[ "$(uname -a)" = *Microsoft*GNU/Linux ]]; then
# if in a WSL shell (typically SUSE or Ubuntu):
if ! [ "$(ls -A /d)" ]; then
# if /d is not mounted yet:
echo "About to mount D:\\ drive if available. ctrlC to cancel."
sudo mkdir -p /d
sudo mount -t drvfs D: /mnt/d \
-o metadata,umask=0077,fmask=0177,uid=1000,gid=1000
# ^ `-t` limits special file types. The rest assumes the current user
# has ID 1000 and sets directories to u=rwx and files to u=rw, with
# permissions to groups and world being denied.
else
echo "D:\\ appears to already be mounted. Carry on."
fi
if ! [[ -d /run/screen ]]; then
echo "Configuring /run directory for screen. ctrlC to cancel."
sudo mkdir -p /run/screen
fi
if [[
"$(whoami)" != "root"
&& "$(ls -ld --color=never /run/screen | cut -d ' ' -f1)" != "drwxrwxrwx"
]]; then
echo "Configuring /run directory for screen. ctrlC to cancel."
sudo chmod 777 /run/screen
fi
fi