arm-config (1812B)
1 #!/usr/bin/env zsh 2 # Copyright (c) 2016 Dyne.org Foundation 3 # arm-sdk is written and maintained by Ivan J. <parazyd@dyne.org> 4 # 5 # This file is part of arm-sdk 6 # 7 # This source code is free software: you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation, either version 3 of the License, or 10 # (at your option) any later version. 11 # 12 # This software is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with this source code. If not, see <http://www.gnu.org/licenses/>. 19 20 ## wannabe raspi-config 21 22 #[[ $UID = 0 ]] || { 23 # dialog --msgbox "$(basename $0) must be ran with root privileges." 10 50 24 #} 25 26 do_about() { 27 dialog --msgbox \ 28 "This tool provides a straightforward way of doing initial configuration of your ARM board. 29 Although it can be run at any time, some of the options may have difficulties if you have heavily customized your installation." 20 70 30 } 31 32 calc_wt_size() { 33 WT_HEIGHT=17 34 WT_WIDTH=$(tput cols) 35 36 if [[ -z "$WT_WIDTH" ]] || [[ "$WT_WIDTH" -lt 60 ]]; then 37 WT_WIDTH=80 38 fi 39 40 if [[ "$WT_WIDTH" -gt 178 ]]; then 41 WT_WIDTH=120 42 fi 43 44 WT_MENU_HEIGHT=$(($WT_HEIGHT-7)) 45 } 46 47 do_expand_rootfs() { 48 49 } 50 51 calc_wt_size 52 FUN=$(\ 53 dialog --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \ 54 "1 Expand Filesystem" "Ensures that all of the SD card storage is available to the user." \ 55 "2 Change root password" "Change password for the root user" \ 56 3>&1 1>&2 2>&3 \ 57 ) 58 59 case "$FUN" in 60 1\ *) do_expand_rootfs;; 61 2\ *) do_change_rootpw;; 62 *) print "fail"; exit 1;; 63 esac