blob: 7bc2cbc2736218e5253bc4f029f2ebe7f9dea169 (
plain)
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
|
#!/bin/bash
basedir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
username="user"
hasuser=0
while getopts u:a:f: flag
do
case "${flag}" in
u) username=${OPTARG}
hasuser=1
;;
esac
done
if [[ $hasuser == 0 ]]; then
read -p "WARNING: username not provided. continue? [y/n] (n):" choice
if [[ $choice != "y" ]]; then
exit 1
fi
fi
echo "working dir: $basedir"
if [[ ! -f "$HOME/.user-done" ]]; then
sh $basedir/user $username
fi
if [[ ! -f "$HOME/.sudo-done" ]]; then
sh $basedir/sudo
fi
sh $basedir/step1
|