Skip to content

Commit

Permalink
only create directory's if not present (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
locus313 authored Apr 19, 2022
1 parent f064da7 commit c0dc300
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@ function _sudo() {
fi
}

function _mkdir() {
if [! -d $NETBASICS_PATH ]; then
$SUDO mkdir -p $NETBASICS_PATH;
fi
if [! -d $LAUNCHDAEMONS_PATH ]; then
$SUDO mkdir -p $LAUNCHDAEMONS_PATH;
fi
}

function _switch() {
_reply="$1"

case $_reply in
""|"i"|"install"|"1")
_sudo
$SUDO mkdir -p $NETBASICS_PATH;
$SUDO mkdir -p $LAUNCHDAEMONS_PATH;
_mkdir
$SUDO cp wireless.sh $NETBASICS_PATH;
$SUDO cp com.computernetworkbasics.wifionoff.plist $LAUNCHDAEMONS_PATH/com.computernetworkbasics.wifionoff.plist;
$SUDO chmod 755 $NETBASICS_PATH/wireless.sh;
Expand Down

0 comments on commit c0dc300

Please sign in to comment.