-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathezsdm
executable file
·59 lines (43 loc) · 1.8 KB
/
ezsdm
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
#
# Simple script to use sdm with plugins
# Edit the text inside the EOF/EOF as appropriate for your configuration
# ** Suggestion: Copy this file to somewhere in your path and edit your copy
# (~/bin is a good location)
function errexit() {
echo -e "$1"
exit 1
}
[ $EUID -eq 0 ] && sudo="" || sudo="sudo"
img="$1"
[ "$img" == "" ] && errexit "? No IMG specified"
[ "$(type -t sdm)" == "" ] && errexit "? sdm is not installed"
[ "$sudo" != "" ] && assets="." || assets="/etc/sdm/local-assets"
[ -f $assets/my.plugins ] && mv $assets/my.plugins $assets/my.plugins.1
(cat <<EOF
# Plugin List generated $(date +"%Y-%m-%d %H:%M:%S")
# Delete user pi if it exists
user:deluser=pi
# Add a new user ** change 'myuser' and 'mypassword' **
user:adduser=myuser|password=mypassword
# Install btwifiset (Control Pi's WiFi from your phone)
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#btwifiset
btwifiset:country=US|timeout=30
# Install apps
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#apps
apps:name=mybrowsers|apps=firefox,chromium-browser
apps:name=mytools|apps=keychain,lsof,iperf3,dnsutils
# Configure network ** change 'myssid' and 'mywifipassword' **
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#network
network:wifissid=myssid|wifipassword=mywifipassword|wificountry=US
# This configuration eliminates the need for piwiz so disable it
disables:piwiz
# Uncomment to enable trim on all disks
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#trim-enable
#trim-enable
# Configure localization settings to the same as this system
# https://github.com/gitbls/sdm/blob/master/Docs/Plugins.md#l10n
L10n:host
EOF
) | bash -c "cat >|$assets/my.plugins"
$sudo sdm --customize --plugin @$assets/my.plugins --extend --xmb 2048 --restart --regen-ssh-host-keys $img