forked from cdelorme/system-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate
More file actions
executable file
·40 lines (35 loc) · 1.27 KB
/
template
File metadata and controls
executable file
·40 lines (35 loc) · 1.27 KB
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
# requires root privileges
[ $(id -u) -ne 0 ] && echo "must be executed with root permissions..." && exit 1
# template
[ -z "$username" ] && username="banana"
[ -z "$password" ] && password="hammock"
[ -z "$dot_files" ] && dot_files="https://raw.githubusercontent.com/cdelorme/dot-files/master/install"
[ -z "$github_username" ] && github_username=$username
[ -z "$create_ssh" ] && create_ssh="y"
[ -z "$ssh_port" ] && ssh_port=22
[ -z "$system_hostname" ] && system_hostname="template"
[ -z "$timezone" ] && timezone="US/Eastern"
[ -z "$jis" ] && jis="y"
[ -z "$cronfile" ] && cronfile="/var/spool/cron/crontabs/${username}"
[ -z "$remote_source" ] && remote_source="https://raw.githubusercontent.com/cdelorme/system-setup/develop/"
# remote commands (would use curl, but base debian does not come with curl)
dl_cmd="wget --no-check-certificate -O"
source_cmd="wget --no-check-certificate -qO-"
# export & printenv
export username
export password
export dot_files
export github_username
export create_ssh
export ssh_port
export system_hostname
export timezone
export jis
export cronfile
export remote_source
export dl_cmd
export source_cmd
env
# begin execution
[ -f "scripts/template.sh" ] && . "scripts/template.sh" || eval "$($source_cmd ${remote_source}scripts/template.sh)"