Permalink
Browse files

updated mac section

  • Loading branch information...
1 parent 10ae3af commit 60dea91bef7acd6c0a650dc53d91aca2f517c61c @chrismatthieu chrismatthieu committed Dec 29, 2011
Showing with 37 additions and 44 deletions.
  1. +8 −0 dependencies_verify.sh
  2. +29 −44 env_creation.sh
@@ -1,6 +1,14 @@
#!/bin/bash
# simple script to verify if youw system already has the needed binary for express
+echo " _ _"
+echo " | | | |"
+echo " _ __ ___ __| | ___ ___| |_ ___ _ __"
+echo "| '_ \ / _ \ / _' |/ _ \/ __| __/ _ \ '__|"
+echo "| | | | (_) | (_| | __/\__ \ || __/ |"
+echo "|_| |_|\___/ \__,_|\___||___/\__\___|_|"
+echo ""
+
# define your system dependencies here
declare -a sys_dependencies
sys_dependencies=("node" "npm" "curl")
View
@@ -1,3 +1,14 @@
+#!/bin/bash
+# install Nodester - Node.JS PaaS
+
+echo " _ _"
+echo " | | | |"
+echo " _ __ ___ __| | ___ ___| |_ ___ _ __"
+echo "| '_ \ / _ \ / _' |/ _ \/ __| __/ _ \ '__|"
+echo "| | | | (_) | (_| | __/\__ \ || __/ |"
+echo "|_| |_|\___/ \__,_|\___||___/\__\___|_|"
+echo ""
+
# CHOOSE THE HOME_DIR FOR THE NODESTER USER
NODESTER_HOME_DIR="/root/nodester"
NODESTER_USER="nodester"
@@ -13,10 +24,23 @@ case $whoami in
echo "You're root! *pew pew*"
case $system in
'Darwin')
- groupadd $NODESTER_GROUP && \
- useradd -d $NODESTER_HOME_DIR -c "nodester user" -g $NODESTER_GROUP -m -r -N -s /bin/bash $NODESTER_USER && \
- (sleep 1s; echo $NODESTER_USER_PASS ; sleep 1s ; echo $NODESTER_USER_PASS) | passwd $NODESTER_USER && \
- break || \
+
+ #### - http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-works-with-leopard/
+ dscl . -create /Users/nodester && \
+ dscl . -create /Users/nodester UserShell /bin/bash && \
+ dscl . -create /Users/nodester RealName "nodester" && \
+ dscl . -create /Users/nodester UniqueID 503 && \
+ dscl . -create /Users/nodester PrimaryGroupID 1000 && \
+ dscl . -create /Users/nodester NFSHomeDirectory $NODESTER_HOME_DIR && \
+ dscl . -passwd /Users/nodester $NODESTER_USER_PASS || \
+ #
+ # sudo /System/Library/ServerSetup/serversetup -createUser $NODESTER_USER $NODESTER_USER NODESTER_USER_PASS && \
+ ###########
+
+ # groupadd $NODESTER_GROUP && \
+ # useradd -d $NODESTER_HOME_DIR -c "nodester user" -g $NODESTER_GROUP -m -r -N -s /bin/bash $NODESTER_USER && \
+ # (sleep 1s; echo $NODESTER_USER_PASS ; sleep 1s ; echo $NODESTER_USER_PASS) | passwd $NODESTER_USER && \
+ # break || \
( echo "error making group/user!" ; exit 1 )
;;
'Linux')
@@ -42,46 +66,7 @@ $NODESTER_USER ALL = NOPASSWD: $NODESTER_HOME_DIR/nodester/scripts/launch_app.sh
( echo "error make FS skeleton!" ; exit 1 )
;;
*)
- echo "You ain't root! *:(*"
- case $system in
- 'Darwin')
-####
-#dscl / -create /Users/toddharris
-#dscl / -create /Users/toddharris UserShell /bin/bash
-#dscl / -create /Users/toddharris RealName "Dr. Todd Harris"
-#dscl / -create /Users/toddharris UniqueID 503
-#dscl / -create /Users/toddharris PrimaryGroupID 1000
-#dscl / -create /Users/toddharris NFSHomeDirectory /Local/Users/toddharris
-#dscl / -passwd /Users/toddharris PASSWORD
-#
-#sudo /System/Library/ServerSetup/serversetup -createUser fullname shortname password
-###########
- groupadd $NODESTER_GROUP && \
- useradd -d $NODESTER_HOME_DIR -c "nodester user" -g $NODESTER_GROUP -m -r -N -s /bin/bash $NODESTER_USER && \
- (sleep 1s; echo $NODESTER_USER_PASS ; sleep 1s ; echo $NODESTER_USER_PASS) | passwd $NODESTER_USER && \
- break || \
- ( echo "error creating user/group!" ; exit 1 )
- ;;
- 'Linux')
- sudo sh -c "groupadd $NODESTER_GROUP &&
- useradd -d $NODESTER_HOME_DIR -c 'nodester user' -g $NODESTER_GROUP -m -r -N -s /bin/bash $NODESTER_USER &&
- ( ( sleep 1s; echo $NODESTER_USER_PASS ; sleep 1s ; echo $NODESTER_USER_PASS ) | passwd $NODESTER_USER ) && break " ||\
- ( echo "*HERE* Error while creating user/group!" ; exit 1 )
- ;;
- '*')
- ( echo "Your OS is not supported yet.. please contact the dev staff" ; exit 1 )
- ;;
- esac
-
- sudo sh -c "mkdir -p $NODESTER_HOME_DIR/.ssh &&
- echo $YOUR_PUB_KEY > $NODESTER_HOME_DIR/.ssh/authorized_keys &&
- chmod -R 700 $NODESTER_HOME_DIR/.ssh &&
- echo \"# nodester related rules
-$NODESTER_USER ALL = NOPASSWD: $NODESTER_HOME_DIR/proxy/start_proxy.sh *
-$NODESTER_USER ALL = NOPASSWD: $NODESTER_HOME_DIR/proxy/stop.sh
-$NODESTER_USER ALL = NOPASSWD: $NODESTER_HOME_DIR/scripts/launch_app.sh *
- \" >> /etc/sudoers && break" ||\
- ( echo "error make FS skeleton!" ; exit 1 )
+ echo "Dude, You ain't root :("
;;
esac

0 comments on commit 60dea91

Please sign in to comment.